Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Current problem: doesn't seem to use the tax_query. No idea why. I've confirmed that $cat is the right value and is getting passed to the query.
- // Expected output: 3 pages with the term I've been using for testing
- // Real output: All published pages, ordered by menu order...
- <?php
- $pl_args = array(
- 'post_type' => 'page',
- 'tax_query' => array(
- array(
- 'taxonomy' => 'seg_proj_cats',
- 'field' => 'slug',
- 'terms' => $cat
- )
- ),
- 'orderby' => 'menu_order',
- 'posts_per_page' => -1
- );
- $pl_pages = new WP_Query( $pl_args );
- if ( $pl_pages->have_posts() ) : while ( $pl_pages->have_posts() ) : $pl_pages->the_post(); ?>
- <a class="seg-proj" href="<?php the_permalink(); ?>"><?php the_title() . the_post_thumbnail( $post->ID, 'react-thumb' ); ?></a>
- <?php endwhile; endif; wp_reset_postdata(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement