Create a tag page on your WordPress blog
January 7, 2009
The problem of displaying tags in your sidebar is that it isn’t really readable, which caused many wordpress bloggers to get rid of tags. How to create a tage page to display your wordpress blog tags in a more readable manner? To create your tag page, the first thing to do is to create a page template. Paste the following code in it if you don’t know how to create one: <?php /* Template Name: Tags */ <h2>All tags</h2> wp_tag_cloud('number=0'); ?> That’s simple as that! The number=0 parameter specifies... [Read the full story]
Use the WordPress 2.7 way to list your pages
November 21, 2008
Wordpress 2.7 will contain a bunch of new functions, as for exemple the wp_page_menu() function. Here’s how to use this new function to create stunning page menus. Prior to WordPress 2.7, we had to use the wp_list_pages() function to get an unordered list of our pages. The main problem was probably that this function can’t handle a link back to your homepage. We had to ad this link manually. This is done without any manual editing with the new wp_page_menu() function: Just add the show_home=Home parameter. Also, another... [Read the full story]
List all wordpress posts on a page
November 20, 2008
How we can create a table of content for his WordPress blog? Here’s a simple code which can also be used to create an archive page. To achieve this recipe, you first need to create a page template. First, on this page template, paste the following code; Then, login to your WordPress dashboard, write a new page and select this page as a template. <?php /* Template Name: All posts */ ?> <?php $debut = 0; //The first article to be displayed ?> <?php while(have_posts()) : the_post(); ?> <h2><?php... [Read the full story]
Display wordpress page loading time and number of queries
November 16, 2008
Do you ever asked yourself how long it took for your page to load, or how many sql queries were executed? If yes, here is a simple code to insert on your template. Nothing hard here. Simply paste the following code on your footer.php file: <?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?> seconds. The get_num_queries() function returns the number of executed query during your page loading. Read More →
Display recently updated wordpress posts and pages
November 11, 2008
Ever wanted to be able to display posts and page that have been updated recently? Paste this code anywhere you’d like to display a list of recently updated posts and pages. You can specify how much item to show by editing the value of the $howMany variable. <?php $today = current_time('mysql', 1); $howMany = 5; //Number of posts you want to display if ( $recentposts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish' AND post_modified_gmt < '$today'... [Read the full story]



















