Created
September 22, 2016 08:29
-
-
Save stevenhoney/e8319c2081d5b3aa296e3c5e1b34130c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$args = array( | |
'post_type' => 'post', | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'your_taxonomy_slug' | |
), | |
), | |
); | |
$query = new WP_Query( $args ); | |
if ( $query->have_posts() ) { | |
while ( $query->have_posts() ) : $query->the_post(); | |
$terms = wp_get_post_terms( $post->ID, 'your_taxonomy_slug', 'names' ); | |
$number = absint( $terms[0] ); | |
if( $number > 100 && $number < 4000 ){ | |
//Do stuf with posts in range | |
} | |
endwhile; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment