<?php /** * Template Name: Partner Category archives * Description: Used as a page template to show page contents, followed by a loop through a CPT archive */ remove_action ('genesis_loop', 'genesis_do_loop'); // Remove the standard loop add_action( 'genesis_loop', 'pods_partnercategory_loop' ); // Add custom loop function pods_partnercategory_loop() { $term = get_term_by('slug',get_query_var('partnercategory' ), 'partnercategory'); echo '<article class="entry"> <header class="entry-header"> <h1 class="entry-title">'.$term->name.'</h1></header> '; $global $paged; $args = array( 'post_type' => 'partner', // enter your custom post type 'orderby' => 'menu_order', 'tax_query' => array( array( 'taxonomy' => 'partnercategory', 'field' => 'slug', 'terms' => get_query_var('partnercategory' ), ), ), 'order' => 'ASC', 'paged' => $paged, // respect pagination 'posts_per_page'=> '-1', // overrides posts per page in theme settings ); $loop = new WP_Query( $args ); if( $loop->have_posts() ){ while( $loop->have_posts() ): $loop->the_post(); global $post; echo pods('partner',$post->ID)->template('Partner List'); endwhile; }else{ echo 'No '.$term->name.' partners found'; } wp_reset_query(); echo ' </div> </div> </div> </article>'; } /** Remove Post Info */ remove_action('genesis_before_post_content','genesis_post_info'); remove_action('genesis_after_post_content','genesis_post_meta'); genesis();
From this forum post:
https://pods.io/forums/topic/use-pods-template-in-taxonomy-archive/
Warning: Please be advised the only part of the code above that has to do with Pods is the one line:
echo pods('partner',$post->ID)->template('Partner List');
Everything else in this example is specific to Genesis and specific to the particular person who submitted it’s requirements. It doesn’t include pagination and it’s replacing an existing loop in Genesis. If you need to know more about Taxonomy Archive and the WP Query, you should be looking at the WordPress Codex, not Pods Documentation.