Query posts with taxonomy based on odd or even

Question

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(
        array(
            'taxonomy' => 'taxonomy-name',
            'field' => 'slug',
            'terms' => 'category-one',
        ) ,
    ) ,
    'orderby' => 'menu_order',
);

--------------------------------------------------

>>> Share a link to this question, just copy and paste the code bellow on your web page <<<

<a href="https://www.wptricks.com/question/query-posts-with-taxonomy-based-on-odd-or-even/">

Query posts with taxonomy based on odd or even</a>
0
, Rain Man 1 month 0 Answers 44 views 0

Leave an answer