Conditioning the loop, not the results displayed
-
Hi there,
I’m working on my loop to show only the posts having some terms.
The way I’m doing it now (inside the loop with has_term(array(), ‘category’)) fails because it is only returning 1 result, but this is not my biggest concern, the problem is that, if I place this conditional inside the loop I do not affect the pagination: for example, if I only have a post with the term “travel” the post will be displayed but the pagination will work like if all the post are listed.
Do I have to put the loop inside the conditional (don’t know how to), so it only loops inside the posts matching the conditions given or should I do something to modify the pagination according to the matching results?
- The topic ‘Conditioning the loop, not the results displayed’ is closed to new replies.