Solved

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

Posted on 2011-02-11
2
715 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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

I want to start by talking about the use of plug-ins for WordPress. I started a web-site for a company I was working for a few years ago; I had extremely basic knowledge of HTML. I am a Graphic Designer by trade so I invited the opportunity as a cha…
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 make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
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…

739 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