Post count within tags TDO Tag fixes
-
OK so I’m looking for some help.
I’m running a copy of WP, with posts organised by category, then using the TDO Tag Fixes plugin I further filter those category pages by tag.
Just for clarification, the URL structure of the site follows this format:
https://example.com/category/
https://example.com/category/?tag=tagnameTo link through to those tag sections, I’ve created some icons – the HTML format for each of these is currently as follows:
<a href="https://example.com.com/<?php echo get_category(get_query_var('cat'))->slug; ?>?tag=tagname" class="tagname_icon"> <span> Arts & Crafts </span> </a>
This is where it gets a little tricky.
What I’d like to do, is check the number of posts matching both the category & tag filtering, then add a specific class to the link if there are more than 0 posts.
I thought I could use query_posts(‘tag=tagname’); to do this, but I can’t use that to filter by both category & tag – so basically, I don’t know what to do from here.
Not sure if this should go in WP-Advanced or not? Anyway, I’d appreciate any help you can provide.
- The topic ‘Post count within tags TDO Tag fixes’ is closed to new replies.