URL with Hierarchical Taxonomies and same slug for all terms and sub-terms
URL with Hierarchical Taxonomies and same slug for all terms and sub-terms
URL with Hierarchical Taxonomies and same slug for all terms and sub-terms
query_posts should never be used. Right now you are getting pagination urls that are relevent to whatever you feed to the query_posts but they lack the url of the page. In general, regardless of the query_posts issue, pagination in internal loops should use pagination parameters which are different than those used by wordpress core, or … Read more
You posted up your localhost which no one will be able to see. When you say filter plugin Facet. Forgive me if I assume wrong when I think you mean FacetWP. Your question involves a bit more depth than you may realize if you’re doing what I think you are doing. I can start you … Read more
Restrict user to terms in a custom taxonomy registered for both posts and users
Shortcode in excerpt
Post types are registered on every load. They’re not stored in the database or some other sort of persistent storage. The posts are, but not the post types. So the correct place to flush rewrite rules is when the theme is activated. This can be done with the after_switch_theme hook: add_action( ‘after_switch_theme’, ‘flush_rewrite_rules’ ); For … Read more
You will need to use this code: $the_query = new WP_Query( array( ‘post_type’ => ‘courses’, ‘tax_query’ => array( array ( ‘taxonomy’ => ‘courses_category’, ‘field’ => ‘slug’, ‘terms’ => ‘yourterm’ ) ), ) ); while ( $the_query->have_posts() ) : $the_query->the_post(); // Show Posts … endwhile; You can convert this in shortcode and just append it on … Read more
How to define a custom hierarchy for terms?
You can use has_term() to check if a post is in a specific term. if ( has_term( ‘reel’, ‘filter’, $post->ID ) ) { get_template_part( ‘loop’, ‘work_feed_reel’ ); } else { get_template_part( ‘loop’, ‘work_feed’ ); }
I frequently see Page templates like this when someone’s trying to create a custom loop – possibly inspired by the built-in functionality of creating a Page as a stub for Posts when another Page is set as the front page for the site. That’s a special case, and not what people should be doing. Instead … Read more