I'm having a terrible time trying to figure this out.
I've registered a custom taxonomy (clinical-programs) and like to list all the PAGES that are assigned to particular page(s).
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI'm having a terrible time trying to figure this out.
I've registered a custom taxonomy (clinical-programs) and like to list all the PAGES that are assigned to particular page(s).
list all the PAGES that are assigned to particular page(s).
I'm assuming you mean "particular term(s)." which would be in your clinical-programs
taxonomy. You'll have to do a bit of coding - you need to start a new WP_Query and structure your query as such:
$taxPages = new WP_Query( array(
'post_type' => 'YOUR_POSTTYPE_HERE',
'clinical-programs' => 'acne-and-rosacea',
'posts_per_page' => 10
) );
You could then add this to a Page Template or you might want to even create a Taxonomy Template by copying your index.php and renameing it taxonomy-clinical-programs.php
Thank you for answering!. I was looking for a more complete solution. I figured it out.
echo '<div class="row profiles">';
$terms = get_terms("clinical-programs");
if ( !empty( $terms ) && !is_wp_error( $terms ) ){
foreach ( $terms as $term ) {
//View faculty member by clinical programs
$view_by_clinical_programs_args = get_posts(array(
'post_type' => 'faculty-clinical',
'posts_per_page' => -1,
'orderby' => 'title',
'order' => 'ASC' ,
'tax_query' => array(
array(
'taxonomy' => 'clinical-programs',
'field' => 'slug',
'terms' => $term->slug
)
)
));
echo '<div class="col-lg-12">';
echo "<h3>" . $term->name . "</h3>";
echo '<div class="row">';
foreach ( $view_by_clinical_programs_args as $post ) {
//var_dump($post);
get_template_part( 'content-faculty-clinical-profiles-medium' );
}
}
echo "</div>";
echo "</div>";
}
echo'</div>';// end row