In the members-only forum a user asked:
There are a number of guides for doing this with categories in Genesis with functions.php code, but I've yet to come across one that works with specific tags instead of categories.
The usage scenario is this: I have some specific tags I use for administrative purposes (eg. featured) that I use as a filter in Genesis Featured Posts Combo and similar widgets. But I don't want those showing up in the post metadata. I do want the other tags showing up, though, so I don't want to just hide all tags.
We can create a custom function hooked to get_the_terms
filter that iterates over all the tags of the current post in the loop, checking for each if it is in a custom array of tags to be excluded and if so remove it from get_the_tag_list()
.
We make use of the above inside the function for a custom [selected_post_tags]
shortcode that shall be used instead of the standard Tagged With: Custom Shortcode, entry meta, get_the_terms, post_tags, Tags
via the genesis_post_meta
filter.
For a Post that has say, "Featured", "Slider" and "Threaded Comments" tags
Before:
After:
where we have specified that "Featured" and "Slider" tags not be shown.
Add the following in child theme's functions.php
:
To view the full content, please sign up for the membership.
Already a member? Log in below or here.
Works wonderfully, including with the Genesis Simple Edits plugin. Thanks so much!
Hi Sridhar, can this be modified to remove categories rather than tags, for usage on a custom post type? Thanks
Does your CPT use the built-in categories or a custom taxonomy?
Custom Taxonomy.
Follow https://sridharkatakam.com/exclude-specific-taxonomy-terms-entry-meta-cpt-pages-genesis/
[…] the comments section of How to exclude specific tags from Entry Meta in Genesis, a user […]