• I been working on my newly creating website and I have the navigation bar to access the forums, chat room, etc, but it also displays the main categories and when I feature a post, it will show up in the little slide show on the home page, so the feature post has to be added to a category named Featured and I don’t want it in the navigation bar.

    I tried plugins, even edited the files my self, still didn’t work, it just will not go away!

    Check it out here: http://askthenerds.com I’m sure that we can figure it out.

    Thanks in advance.

Viewing 5 replies - 1 through 5 (of 5 total)
  • edited the files my self

    can you post the lines of code that you edited?
    what plugins?

    ‘normally’ the category navigation menu is done with ‘wp_list_categories()’ which has a ‘exclude’ parameter

    http://codex.wordpress.org/Template_Tags/wp_list_categories
    http://codex.wordpress.org/Template_Tags/wp_list_categories#Include_or_Exclude_Categories

    Thread Starter Nicholas

    (@nerwin)

    This what I been working on:

    <ul id="nav2" class="clearfloat">
    
    <li><a>/" class="on">Home</a></li>
    <li><a href="/about">About</a></li>
    <li><a href="/contact">Contact</a></li>
    <li><a href="/forums">Forums</a></li>
    <li><a href="/lounge">Lounge</a></li>
    <li><a href="/editors">Editors</a></li>
    <li><a href="/ask">Ask Us!</a></li>
     <?php wp_list_categories('orderby=name&exlude=181&title_li=');
     $this_category = get_category($cat);
     if (get_category_children($this_category->cat_ID) != "-21") {
     echo "
    <ul>";
     wp_list_categories('orderby=id&show_count=0&title_li=
     &use_desc_for_title=1&child_of='.$this_category->cat_ID);
     echo "</ul>
    ";
     }
    Thread Starter Nicholas

    (@nerwin)

    sorry double post..

    ‘featured’ seems to be cat 21:

    <li class="cat-item cat-item-21"><a href="http://askthenerds.com/category/featured/" title="View all posts filed under Featured">Featured</a>
    </li>

    cat 181 is successfully excluded.

    Thread Starter Nicholas

    (@nerwin)

    Haha, Wow, I can’t believe I didn’t think about this.

    For some reason, exclude was spelled exlude (maybe it was the coder’s error?) Well changed that to “exclude” and replaced 181 with 21 and it worked!

    Cat. 181 doesn’t exist, maybe it was for another website at one time, well anyways, this worked!

    Thanks for your helping! So happy now!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Removing a category from the navigation bar’ is closed to new replies.