count results in search page based on custom category
Have you tried wp_count_posts ? http://codex.wordpress.org/Function_Reference/wp_count_posts I think that will work here.
Have you tried wp_count_posts ? http://codex.wordpress.org/Function_Reference/wp_count_posts I think that will work here.
If you hook into the ‘rewrite_rules_array’ filter, do a print_r on $rules, and you’ll see the huge preg-match key-value pairs. add_filter( ‘rewrite_rules_array’,’mess_with_rewrite_rules’ ); function mess_with_rewrite_rules( $rules ) { print_pre($rules); return $rules; } See where your rule is in the stack. WordPress loops through this list looking for anything that matches the keys, which are regex … Read more
I just had this exact problem, and it came down to a bizarre naming issue that I can’t explain. I have a post type event and I created a taxonomy event_tag. It exhibited the behavior you describe, as did any tax name beginning with event. Changing it to anything that didn’t begin with event made … Read more
Okay, I figure it out. Instead of using wp_nav_menu, I use wp_list_categories which has more parameters that we can control. So to not display empty menu, I use: <?php wp_list_categories(array(‘taxonomy’ => ‘custom_tax’,’hide_empty’ => ‘1’,’title_li’ => ”)); ?> the hide_empty do the magic here.
Just use a translated slug: // Use a translated slug in pretty permalinks ‘rewrite’ => array ( ‘slug’ => _x( ‘default-slug’, ‘slug’, ‘your_text_domain’ ), ‘with_front’ => FALSE ), In your translation you can change the slug now like everything else.
WordPress subpages to custom post types
Using custom taxonomies to display hierarchical URLs?
Reference: WordPress Codex — Custom Taxonomies > Querying by taxonomy Creating a taxonomy generally automatically creates a special query variable using WP_Query class, which we can use to retrieve posts based on. For example, to pull a list of posts that have “Bob” as a “person” taxonomy in them, we will use: $query = new … Read more
Show fields based on taxonomy selection in editor
List Posts For Terms Of A Custom Taxonomy For Any Post Type