Community Forums › Forums › Archived Forums › Design Tips and Tricks › Hiding functional categories from post meta info
Tagged: categories
- This topic has 3 replies, 2 voices, and was last updated 11 years, 1 month ago by
Brad Dalton.
-
AuthorPosts
-
January 4, 2014 at 12:54 pm #83221
capito
MemberGenesis Framework, custom child theme
I have run into the need to utilize purely functional/internal categories in order to filter my content out to my subscribers appropriately. I do not want those categories to show up on my posts on the website.
I have found wordpress solutions for hiding a category, but they require accessing a php file that is located within the core framework, which I obviously should not edit.
Example typical solution:
http://codegrad.hub.ph/excluding-categories-in-wordpress-post-category-list/I do not have a php file in my child theme that is calling: <?php the_category(', ') ?> - which I would need to edit in order to get this solution to work.
I am using a custom child theme that contains functions.php, page-holding.php, page-no-sidebar.php, single_featured-products.php, and the stylesheet. Built by a consultant.
Any advice or guidance would be greatly appreciated as I cannot think of another way to send the correct content to the correct lists without the use of categories and the current set-up will result in two to three categories per post, with one to two being completely inexplicable to the reader. Open to other ideas or plugins besides using categories.
Thanks!
Offending categories: Mission, Universal
http://blog.impactignition.comJanuary 4, 2014 at 1:00 pm #83224Brad Dalton
ParticipantTry this http://wpsites.net/web-design/exclude-category-posts-page/
These are the category i.d's you can change to your own, comma separated with a minus before them.
-27,-30
Please copy ALL the code from the view raw link and paste it at the end of your child themes functions.php file using a text editor like Notepad++
January 4, 2014 at 4:14 pm #83260capito
MemberThanks, Brad. Being a newbie, forgive me if I am misinterpreting, but it looks like that code would exclude any posts with those categories from showing up on the home page, correct?
What I need is for the post metadata that shows after each post title to not show those categories - since they are purely internal management categories and not categories that are helpful for the reader in navigating the blog.
Ex. Why your mission needs business partners posted on Collaboration, Mission
I used the Mission and Universal categories so that Mailchimp delivers a category-based feed to those on my list who want that type of content. Collaboration is a genuine category that the reader can use to find additional posts in that genre, but I don't want the Mission and Universal category tags to show.
January 4, 2014 at 4:36 pm #83265Brad Dalton
ParticipantBit hard to understand your question.
What are the exact tag or category names you want to hide?
The code depends on whether you're using a XHTML or HTML child theme because the loop hooks have changed.
You can do all this conditionally using the has_tag() and in_category() conditional tags.
add_filter( 'genesis_post_meta', 'sp_post_meta_filter' ); function sp_post_meta_filter($post_meta) { $post_meta = '[post_categories] [post_tags]'; return $post_meta; }
You need to add the conditional after the function.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.