I have to create a list of post for a random tags. 5 of them which should comes under X category and 15 of them should not come under X category. I have summarized my query here and its fine.

array(
'tag_id' => $tag->term_id,
'category__not_in' => array($X_category),
'type' => 'post'
);

array(
'tag_id' => $tag->term_id,
'category__in' => array($X_category),
'type' => 'post'
);

The issue here is I don’t understand how to add pagination through wordpress default function for this scenario. (I could add pagination manually, but it seems to be painful.)

Read more here: I have to add pagination on list of post based on tags and two categories


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: