Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Need a PHP and Wordpress expert? Go to www.inovve.com
- For Instance you don’t want to show the category Uncategorized and Private, in order to do so first put the paste code at the end of your functions.php located in your current theme folder.
- function the_category_filter($thelist,$separator=' ') {
- if(!defined('WP_ADMIN')) {
- //Category Names to exclude
- $exclude = array('Uncategorized', 'Private');
- $cats = explode($separator,$thelist);
- $newlist = array();
- foreach($cats as $cat) {
- $catname = trim(strip_tags($cat));
- if(!in_array($catname,$exclude))
- $newlist[] = $cat;
- }
- return implode($separator,$newlist);
- } else {
- return $thelist;
- }
- }
- add_filter('the_category','the_category_filter', 10, 2);
Advertisement
Add Comment
Please, Sign In to add comment