0

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).

enter image description here

  • You want to list Pages, but are showing the Categories Meta Box. What exactly is your problem? Please file an edit and be more verbose with both your setup as well as your problem. – kaiser Dec 10 '14 at 3:14
1

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

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.