Query posts with taxonomy based on odd or even


I have several posts under a custom taxonomy. The posts look like this under the post type:

1. Post title (category one)
2. Post title (category two)
3. Post title (category two)
4. Post title (category one)
5. Post title (category two)
6. Post title (category one)

I want to query posts for category one so these are the posts which I want but I also want to query the posts based on odd or even posts after filtering them by taxonomy:

1. Post title (category one) (post is odd)
4. Post title (category one) (post is even)
6. Post title (category one) (post is odd)

Here is the query that filters the post by taxonomy, but how can I filter it to show the odd posts only?

$args = array(
    'post_type' => 'post-type',
    'posts_per_page' => - 1,
    'tax_query' => array(
            'taxonomy' => 'taxonomy-name',
            'field' => 'slug',
            'terms' => 'category-one',
        ) ,
    ) ,
    'orderby' => 'menu_order',
, Rain Man 3 years 2020-06-01T14:10:24-05:00 0 Answers 89 views 0

Leave an answer