Display content between two dates?

<?php <br /> function filter_where($where=””) {<br/> $where .= ” AND post_date >= ‘1980-05-11’ AND post_date <= ‘2011-05-11′”;<br/ > return $where;</br> }<br/> add_filter(‘posts_where’, ‘filter_where’);<br/> query_posts($query_string);<br/> while (have_posts()) :<br/> the_post();<br/> the_content();<br/> endwhile;<br/> ?> get meta data value and replace with the numeric date.

How to output all taxonomy links from a custom post type in a menu?

You can use wp_list_categories() which by default, generates nested unordered lists (ul) and just pass product-category as the taxonomy parameter for example: add_filter(‘wp_nav_menu_items’,’add_custom categories’, 10, 2); function add_custom categories($items, $args) { $items .= ‘<li>’ . wp_list_categories( array(‘echo’ => 0, ‘taxonomy’ => ‘product-category’, ‘title_li’ => ‘Product Categories’) ) . ‘</li>’; return $items; }

Am getting duplicate data from get_posts()

Without looking at the database data (posts, inherits, etc), it’s a bit of guesswork. Try the following: Make sure you have “post_type”=>”post” specified, so that you don’t get auto-saved inherits (if it defaults to ‘any’). If this is an isolated query (not meant to be main loop), use $q = new WP_Query() and run it … Read more

How-to show last 5 posts

global $wpdb, $post; // Uses current POST here $IDs = $wpdb->get_col(“SELECT `ID` FROM {$wpdb->posts} WHERE `post_type`='{$post->post_type}’ AND `post_status`=’publish’ AND `ID`<{$post->ID} ORDER BY `ID` DESC LIMIT 5;”); This function lists the 5 posts with IDs lower then ID 176 that are of post_type=”post” and post_status=”publish”. Change post_type if you use a custom post type to whatever … Read more

How To Use Custom Tax of a Post Type

You can either set the taxonomies parameter of register_post_type, which accepts an array of taxonomies, or set object type to your custom post type (or array of types) when you register your taxonomy, or you can use the register_taxonomy_for_object_type function.

YARPP php question

Are you setting the border using CSS? If so, you should set “Default display if no results:” under Settings to nothing. If that is nothing, YARPP will show nothing.

Deleting old posts

You should submit a request for Google to stop indexing them as soon as possible (accessible through the Google Webmaster Tools interface). I’m sure you know the purpose of posts, but is is that important to delete them? You could just leave them as an archive as posts were originally meant for. If you don’t … Read more