Solved

How can I hide categories in wp-admin edit page?

Posted on 2011-02-11
2
705 Views
Last Modified: 2012-05-11
I know I can hide categories from the front pages with 'exclude' like this:

<?php wp_list_categories('title_li=&orderby=id&hide_empty=0&exclude=1,13,78,79,3023'); ?>

What I need to do now though, is hide them on the add/edit post pages on the backend. I need to leave these categories in place for legacy... but I want to limit my authors to choosing only the new categories I now have.

Is there a way I can hide those, perhaps something I could put in theme/function.php or something like that?

Thanks,  Chris

0
Comment
Question by:St_Aug_Beach_Bum
2 Comments
 
LVL 17

Accepted Solution

by:
jrm213jrm213 earned 500 total points
ID: 34891566
I don't believe that there is any way to do that through wordpress.  There isn't anything in the database that you denotes if a category is active or has a daterange for the category begin or category end. It would be nice though.

Hover the way that those items are displayed on the page could be changed. In the add/edit post pages those items are listed as

category-id

ie

<li class="popular-category" id="category-9"><label class="selectit"><input type="checkbox" id="in-category-9" name="post_category[]" value="9"> Newletters</label></li>

create a file in your themes folder in a directory called css for example: your-theme/css/hidden-categories.css and in it place the categories you don't want people to choose like below

#category-9, #category-15
{
display: none;
}


then include that css into the site via your themes function.php file. Add this to the bottom of functions.php in your themes file.

wp_register_style('my-style', get_bloginfo( 'stylesheet_directory' ) . '/css/hidden-categories.css', false, 0.1);
wp_enqueue_style( 'my-style' );

0
 

Author Closing Comment

by:St_Aug_Beach_Bum
ID: 34891809
Brilliant!!!!!!!  Thank you!   Chris
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In Part I (http://www.experts-exchange.com/Web_Development/Blogs/WordPress/A_8410-Getting-Started-In-WordPress-Part-I.html), I introduced you to the powerful WordPress backend, the WordPress administrative Dashboard.  In Part II, I will introduce yo…
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now