Display post based on custom fields with a custom query
February 20, 2009
Many blogger interested to know how to be able to display posts based on custom fields values. The first thing to do is to create a page template. The code below will display your posts, based on the following condition: Post must have a custom field with key tag and value email. Of course, you can change it in the query to make the code fits your needs. <?php /* Template Name: Custom query */ $querystr = " SELECT wposts.* FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id ... [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 →



















