Conditional: is current single post newest/oldest post in category?
-
I’m currently developing a WordPress theme for use as an artist’s portfolio. Posts are individual paintings, which are grouped into Categories.
At the top of each post, navigation links allow the user to go to the Next/Previous painting (post) within the category.
Currently, when the user navigates to the first (most recent) or last (oldest) Post in the Category, the “Previous” or “Next” navigation links disappear, respectively. What I’d like to have happen is for the link text to remain, but to be grayed out and inactive. To do this, I’m trying to figure out how to write a conditional statement in the ‘Single’ template that would check to see if the current Post is the most recent or oldest Post in the Category. But so far I’ve been unsuccessful.
I’ve searched around and seen numerous examples of using variables as counters, however this is only useful when there are multiple Posts displayed on one page. I need to find out if the current single post is the most recent or oldest Post in the Category.
Is there something simple I’m overlooking? I appreciate any insight you might have.
- The topic ‘Conditional: is current single post newest/oldest post in category?’ is closed to new replies.