Hide Category names from Post Meta in WordPress
Updated On May 27, 2017 August 23, 2015 -Written ByDo you want to hide or remove a specific category from displaying in the post meta area of a WordPress theme? By default, we can either remove or hide all categories or display all categories assigned to a specific post. Since, each category does not have unique CSS class, we can not use display:none; function to target a specific category.
PHP code to remove Categories from post meta
Just add following code to functions.php file of your theme. It should work on any WordPress theme (it was tested successfully on Genesis Sample Theme).
https://gist.github.com/21635713a04dbaf3414d
The above code removes: “Featured” and “Category #1” from the post meta area. (Code Credits)
Before & After in Genesis Sample theme
If you use categories for personal organization of posts in the back-end, you can easily hide those categories assigned to posts in the front end using code shared above.
Perfect, This is just what I was looking for. Thanks for sharing
Hi! First of all let me send you my gratitude for showing me how to get rid of the “Uncategorized” title! Can you please show me how to get rid as well of the “/” in “Uncategorized / May 12, 2017”?
Thanks!!
1.In your editor find content-single.php (under the template-parts).
2. You should find something similar to this:
<!–\ –>
3. Delete the \
4. Update File
For some reason this code, which has been and continues to work flawlessly in the Misty Lake theme does not seem to work when transplanted to the Graphy theme.
Any help appreciated.