Solved

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

Posted on 2011-02-11
2
716 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

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

Do you think that WordPress is just for blogs?  Think again!  WordPress is really a fantastic all around platform that you can use to develop websites on.  Integrated into its basic functionality is the ability to create pages using your choice of a…
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 integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

691 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