Category: WordPress

Building an eCommerce Website in WordPress

These simple tips for making your WordPress ecommerce site a success. Use them as a checklist for reviewing your current site and then make a list of what you can easily implement. Small improvements like these...

How to add .html extension to Pages?

Recently creating a WordPress site and i noticed a little problem, you can add .html in the settings which work fine for POSTS but not pages! I wrote a small plugin that will add...

Is your plugin Naughty or Nice?

WordPress 2.1 is almost here and you know what that means for developers. It’s time to pull out those old plugins you’ve had stashed, blow off the dust and start applying some spit and...

WordPress 3.6 Beta 2 is now available!

This is software still in development and we really don’t recommend that you run it on a production site — set up a test site just to play with the new version. To test WordPress 3.6, try the WordPress...

WordPress 10th Anniversary Tees at $10

In honor of the upcoming 10th anniversary celebrations, we’ve put a special 10th anniversary tshirt in the swag store at cost — $10 per shirt plus shipping. They’ll be on sale at this price...

How to Turn on WordPress Error Reporting?

Comment out the top line there, and add the rest to your wp-config.php file to get more detailed error reporting from your WordPress site. Definitely don’t do this live, do it for local development and testing....

Useful tips about Custom Fields in wordpress

Dump out all custom fields as a list <?php the_meta(); ?> Display value of one specific custom field <?php echo get_post_meta($post->ID, ‘mood’, true); ?> “mood” would be ID value of custom field Display multiple...

How to Find ID of Top-Most Parent Page?

This will find what the ID is of the top-most parent Page, in a nested child page. For example, this page you are literally looking at is nested under <?php if ($post->post_parent) { $ancestors=get_post_ancestors($post->ID);...

How to Dump All Custom Fields in WordPress

WordPress has a built in function, the_meta(), for outputting all custom fields. But this function is limited in that it doesn’t always output all of them. For example, it misses custom fields added by...

How to Display Post Divider In Between Posts

Right before the closing of the The Loop, insert this code: <?php if (($wp_query->current_post + 1) < ($wp_query->post_count)) { echo ‘<div>Post Divider</div>’; } ?> This will create a <div> you can style as a post divider....

How to set Custom Database Error Page in WordPress?

Put a file called “db-error.php” directly inside your /wp-content/ folder and WordPress will automatically use that when there is a database connection problem. <?php // custom WordPress database error page header(‘HTTP/1.1 503 Service Temporarily...

How to add Bloginfo Shortcode?

The bloginfo() function in WordPress gives you access to lots of useful information about your site. See the complete list. To access all these values from inside Page/Post content itself, we can make a shortcode...

Get WordPress Post ID from Post title

Found a solution if anyone else struggles with this. Only posted the question out of desperation after 4 hours testing/Googling! function get_post_by_title($page_title, $output = OBJECT) { global $wpdb; $post = $wpdb->get_var( $wpdb->prepare( “SELECT ID...

How to Turn on WordPress Error Reporting

Comment out the top line there, and add the rest to your wp-config.php file to get more detailed error reporting from your WordPress site. Definitely don’t do this live, do it for local development and testing....

How get Year Shortcode for a wordpress website?

For the functions.php file: function year_shortcode() { $year = date(‘Y’); return $year; } add_shortcode(‘year’, ‘year_shortcode’); Usage Use [year] in your posts.