WordPress query posts by custom post type not workng

It’s a bad use of Query you may look at this post In this case use a secondary query with your own instance of WP Query. query_posts() is not recommanded here cause it overrides the main query. <?php $args = array( ‘post_type’ => ‘instrument’, ‘post_status’ => ‘publish’, ‘ignore_sticky_posts’ => 1, ); $my_query = new WP_Query( … Read more

Looping through custom taxonomy in one template

As Template hierarchy says, there are 5 possible file names for displaying taxonomy: taxonomy-{taxonomy}-{term}.php – If the taxonomy is sometax, and taxonomy’s term is someterm, WordPress will look for taxonomy-sometax-someterm.php. In the case of post formats, the taxonomy is ‘post_format’ and the terms are ‘post-format-{format}. i.e. taxonomy-post_format-post-format-link.php for the link post format. taxonomy-{taxonomy}.php – If … Read more

Multi level archive

This is a direction. Not tested but you have an idea. <?php // get current term $term = get_term_by( ‘slug’, get_query_var(‘term’), get_query_var(‘taxonomy’) ); // get parent term $parent = get_term($term->parent, get_query_var(‘taxonomy’) ); // get children $children = get_term_children($term->term_id, get_query_var(‘taxonomy’)); $taxonomy = ‘business-types’; if ( empty($parent->term_id) ) { echo ‘<a href=”‘ . esc_url( get_term_link( $term ) … Read more