Question about has_tag condition
If I use a has_tag condition on my loop, will the loop go through posts until it finds something with that tag, or will it quit looking after so many posts?
On my loop-index.php, I want to display articles tagged “featured-article”, so I’ve used this condition just after I start my loop:
<?php if ( has_tag('featured-article') ) : ?>
It worked pretty well until someone went through and added a bunch of other posts without using that tag in them.
You can see my loop-index displaying an article with that tag, but not until eleven pages along: http://dev.renacademy.org/charter-school/page/11/
I’ve tried going through the documentation and maybe I’ve missed something, but as far as I can tell, we should expect the loop to keep looking for that tag until it has enough posts for that page.
By the way, I did notice a sticky post feature that probably would work as well for what we’re trying to do in this instance, but we’ll probably want to add other tag-conditioned loops to our index later, so I’d appreciate any ideas you have.
Thanks in advance,
- The topic ‘Question about has_tag condition’ is closed to new replies.