How To More Easily Assign Categories To Your Posts In WordPress?

WordPress post editing screen provides you a category metabox showing a hierarchy list of your website categories. But when you have a large number of categories then it it becomes very difficult to scroll and assign categories in post edit screen. In this tutorial we will show you how to make make this process more easy by adding some useful features to category selection metabox present in ADD NEW/ EDIT post pages.

This slideshow requires JavaScript.

You Can Make Categories Metabox Searchable

Deafult categories metabox provides you categories checklist but you can make it searchable. A searchable category metabox will let you and your website authors to type in the search box and categories will be shown and hidden in real time. Thus enabling you to easily select the relevant categories without having to scroll through possibly hundreds of categories. All you have to do is install and activate Searchable Categories plugin.

You Can Expand Your Category Checklist

You can also increase the height of your category checklist metabox so that it can show all categories and you can easily select & assign them to your posts. No more scrolling! It makes all of your categories visible.

Simply open your theme’s function.php file and add the following code:

function cws_category_checklist_expander_css() {
    global $wp_version, $pagenow;
    if ( !in_array( $pagenow, array( 'post.php', 'post-new.php' ) ) )
        return;
    $tabs_panel = ( version_compare( $wp_version, '2.7.9', '<' ) ) ? 'ui-tabs-panel' : 'tabs-panel'; // class name changed in 2.8
?>
<style>
#categorydiv div.<?php echo $tabs_panel; ?>, #linkcategorydiv div.<?php echo $tabs_panel; ?> { height: auto; max-height: none; }
</style>
<?php
}

add_action( 'admin_head', 'cws_category_checklist_expander_css' );

Alternatively, you can use the Category Checklist Expander plugin which does the same thing. Simply install and activate it and you’re done.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.