I really doubt if this is possible but I would like to filter a custom post type with Isotope based on the tag of the post and not the taxonomy.

I'm currently using $terms = get_terms("taxonomy"); to filter CPT's but tags could be anything.

The reason why I would like to filter it this way is that the client want to show projects (CPT) on two pages. One for finished projects and one for planned projects. Within the finished projects page you should be able to filter the projects.

I could do this the easy way to create two different CPT's; one for planned projects and one for finished projects. But this way the client has to enter all the details of the project again once the planned project is finished.

If anyone knows how to filter CPT's by tags or has a creative solution that would be nice as I'm currently stuck based on my own WordPress knowledge.

  • 2
    I'm not sure I understand your question. tags are a taxonomy, if you've already got filtering working based on a custom taxonomy, you can just change that to post_tag to work with tags. – Milo Dec 11 '14 at 16:35
  • "tags could be anything." just like taxonomy terms could be anything. To filter posts by these, you don't need to know what the tag is, you just need to pass it along and look for it in the database. Check out the WP_Query Docs on Tags. – Howdy_McGee Dec 11 '14 at 16:41
  • Hmz, I didn't knew that Milo. If it's that easy... I'll give it a try and see if it works. Thanks! – NielsPilon Dec 11 '14 at 16:47
  • Tested and the answer of – NielsPilon Dec 12 '14 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.