- This topic has 3 replies, 2 voices, and was last updated 6 years, 2 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
These forums are now closed and remain for historical purposes.
None of the content applies to the new version 3. For support, get in touch via our contact form.
Forums › Forums › Search & Filter Pro › reset query
Tagged: reset query nth child
Hello
I want to reset my query so i can target each post even/odd with :nth. But it doesn’t seem to work when i use this in the results.php file:
<?php wp_reset_postdata(); ?>
<?php wp_reset_query(); ?>
Any suggestions to how i can separate each post section from each other?
If you are running through the posts with a loop, then it would be easier to have a variable that is set alternately to:
post-odd
post-even
And echo that in the classes of the element you wish to target.
I am not sure why you need to reset the query?