Removing unnecessary numbers appended to postname in permalinks

There is a plugin for wordpress which allows you to handle 404 errors and redirect to specific pages. So if wordpress calls your post /events/2013/june/fishing-trip-2, you could go into the plugin and add a rule so that /events/2013/june/fishing-trip points to /events/2013/june/fishing-trip-2. It’s not a perfect solution, as you’d have to manually enter each duplicate post … Read more

Per Post Type Revision Numbers

Remove the action ‘wp_save_post_revision’ from ‘pre_post_update’. It is set per default in wp-includes/default-filters.php with the default priority (10). Add your own function to this hook. You get the $post_ID as parameter, so detecting the post type is easy. In your callback copy the code from wp_save_post_revision() but use the constant WP_POST_REVISIONS for the post type … Read more

How to filter custom posts by tags and custom fields?

you can use custom taxonomies and make you query_posts much easier! by that i mean create a custom taxonomy for type,duration like so: add_action(‘init’,’register_event_tax’); function register_event_tax(){ register_taxonomy(‘even_type’,array(‘events’), array( ‘hierarchical’ => false, ‘labels’ => ‘type’, ‘show_ui’ => true, ‘query_var’ => true, ‘rewrite’ => array( ‘slug’ => ‘type’ ), )); register_taxonomy(‘even_duration’,array(‘events’), array( ‘hierarchical’ => false, ‘labels’ => … Read more

Custom Post Type and Taxonomy URL rewrite

I have used my jewelery post type bellows code, You can just replace your post type & taxonomy. Just copy & paste on your functions file. <?php //Register a Jewelry post type. function jewelry_post_register() { $labels = array( ‘name’ => _x( ‘Jewelries’, ‘post type general name’, ‘twentytwelve’ ), ‘singular_name’ => _x( ‘Jewelry’, ‘post type singular … Read more

How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy

After adding print_r($wp_query); to my template and examining the results, I have discovered URL formats that work. I wrote, in my question, that the following format doesn’t work — in fact, it does – if you spell your custom taxonomy name correctly. example.com/?ctxname=term1+term2 Pretty URLs with the ‘+’ and ‘,’ operators (indicating AND and OR … Read more