Any help would be greatly appreciated!
I have a Custom Post Type 'video', with a taxonomy 'tax-video' and I'm looping through posts in the sub-taxonomy term 't-o-t-w'. I need to exclude the latest/most recent post.
I've been searching around for a couple hours trying different things, but still don't really even know where to start. Here's what I've tried, but it breaks the page:
<?php //trying to get the recent post $tip = get_terms('t-o-t-w','orderby=id&order=DESC&number=1'); $latest_tip = $tip->ID; $args = array( 'post_type' => 'video', 'tax_query' => array( array( 'taxonomy' => 'tax-video', 'field' => 'slug', 'terms' => 't-o-t-w', ), ), 'posts_per_page' => '8', //Trying to Exclude it here 'post__not_in' => array( $latest_tip ), ); $query = new WP_Query( $args ); ?> <?php if( $query->have_posts() ) : while( $query->have_posts() ) : $query->the_post(); ?> //code to be executed <?php endwhile; endif; wp_reset_postdata(); ?>