Last active
September 22, 2016 08:30
-
-
Save stevenhoney/f24e5a0c3d1766cc1fb245a4921b29da 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] ); // Assuming you will only add one number per post so first array item will be correct | |
if( $number > 100 && $number < 4000 ){ | |
//Do stuf with posts in range 100 - 4000 | |
} | |
endwhile; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment