Apply the ID to element from query_posts just once
I have this second query and I can’t use pagination as I am using another query before which extracts just one post from the same category but styled differently.
Now, with the second query I use offset=1 so I won’t have the last post twice, therefore my WP-PageNavi doesn’t work as expected anymore.
What I’ve done is to add an id to the containing div:
id="<?php if ($wp_query->current_post < 1) echo "the-first-post"; ?>"
And this applies that id which I can hide with CSS but the problem is, the first containing element from the second page gets, obviously, the same ID.
Is there any possibility to make it somehow to apply the ID just once? This way I will get this pagination issue sorted. Or.. to apply the id IF the page doesn’t contain “page” in the URL? That might be the solution.
- The topic ‘Apply the ID to element from query_posts just once’ is closed to new replies.