Custom Post Type with Taxonomy Page Loop, How to sort and display all
-
I’m always having issues sorting, displaying, the right taxonomy term from a custom post type. So for now I have CPT of Clients. Taxonomy of Client (client categories), then terms such as Diagnostics, Devices, Theraputics, etc. Obviously I don’t want to make a taxonomy.php page for all of them (I have taxonomy-client.php now). So this code works to display the proper terms (categories). But I need to be able to sort by title and display all posts.
<?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); ?> <?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?> <h2><?php the_title();?></h2> <div class="content"><?php the_content(); ?></div> <?php endwhile; ?><?php endif; ?>
Please help!
- The topic ‘Custom Post Type with Taxonomy Page Loop, How to sort and display all’ is closed to new replies.