Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $post_type = 'custom_post_type';
- $post_tax = 'custom_post_taxonomy';
- $posts_per_pag = 4;
- $tax_terms = get_terms($post_tax, array('orderby' => 'id', 'order' => 'DESC'));
- if ($tax_terms) {
- foreach ($tax_terms as $tax_term) {
- $args = array('post_type' => $post_type, "$post_tax" => $tax_term->slug, 'posts_per_page' => $posts_per_page, 'paged' => $paged);
- $t4b_query = new WP_Query($args);
- if ($t4b_query->have_posts()) :
- while ($t4b_query->have_posts()) : $t4b_query->the_post(); ?>
- <div><!--SHOW CUSTOM POST ITEMS --></div><?php
- endwhile;
- getpagenavi();
- wp_reset_query();
- else : ?>
- <h2>Not Found</h2><?php
- endif;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement