0

I am using koresponsive theme. I am displaying name of categories as my menu bar just below my header. Now I need to remove 'Uncategorized' category from displaying it in the menu bar. How can I do it? What is the code.Please help me.

Here is my header.php. I guess I have to change in wp_list_categories. I tried many ways. But it is not working.

    <!DOCTYPE html>
    <?php $options = get_option('koresponsive'); ?>
   <html class="no-js" <?php language_attributes(); ?>>
    <head>
<meta charset="<?php bloginfo('charset'); ?>">
<title><?php wp_title(''); ?></title>
<?php kore_meta(); ?>
 <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php wp_enqueue_script("jquery"); ?>
<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<?php kore_head(); ?>
<?php wp_head(); ?>
    <?php if (is_front_page()) { ?>
<script>
jQuery(document).ready(function($){
    $('#slides').slides({
        preload: true,
        preloadImage: '<?php echo get_template_directory_uri(); ?>/images/loading.gif',
        play: 5000,
        pause: 2500,
        hoverPause: true,
        generatePagination: false

    });
});
</script>
  <?php } ?>      
  </head>
 <?php flush(); ?>
  <body id ="blog" <?php body_class('main'); ?>>
<header class="main-header">
    <div class="container">

        <div id="header">

            <?php if( is_front_page() || is_home() || is_404() ) { ?>
                    <h1 id="logo">
                        <a href="<?php echo home_url(); ?>"><?php bloginfo( 'name' ); ?></a>
                    </h1>  <!-- FINE #logo -->
            <?php } else { ?>
                    <h2 id="logo">
                        <a href="<?php echo home_url(); ?>"><?php bloginfo( 'name' ); ?></a> 
                    </h2>  <!-- FINE #logo -->
            <?php } ?> 
             <?php if ( !function_exists('dynamic_sidebar')
     || !dynamic_sidebar('Top Widget') ) : ?>
        <?php endif; ?>         
        </div><!--FINE #header-->
        <div class="second-nav">
                <nav id="navigation" >
                    <?php if ( has_nav_menu( 'primary-menu' ) ) { ?>
                        <?php wp_nav_menu(   array( 'theme_location' => 'primary-menu', 'menu_class' => 'menu', 'container' => '' ) ); ?>
                    <?php } else { ?>

                        <ul class="menu">
                            <?php wp_list_categories('title_li='); ?>

                        </ul>
                    <?php } ?>
                </nav>
            </div> 
    </div><!--container-->        
     </header>
   <div class="main-c">

1 Answer 1

0

You have to add the argument to exclude the 'Uncategorised' category using this:

<?php wp_list_categories('title_li=&exclude=XX'); ?>

where XX is the ID of the category to exclude.

Here is the codex page http://codex.wordpress.org/Template_Tags/wp_list_categories#Include_or_Exclude_Categories

2
  • thank you lucio.I tried it it.BUt it didn't worked.I am not able to get category id. Commented Nov 15, 2013 at 10:10
  • the id of the 'Uncategorised' category is 1. wp_list_categories('exclude=1&title_li='); Commented Nov 15, 2013 at 10:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.