WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How do I stop a category appearing in the Secondary Menu (11 posts)

  1. padraigstapleton
    Member
    Posted 3 years ago #

    Hi there, I'm creating a WordPress.org site offline. I've been trying to insert a slider and had to create a separate category that i called 'slider'. The slider works now but it's now appearing in the secondary menu bar. Any idea how I hide the category from the menu bar? I still need the category for the slider, thank you!

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    What are you using to list categories in the main menu?

  3. padraigstapleton
    Member
    Posted 3 years ago #

    I'm not sure what you mean but here is a screenshot...

    http://i51.tinypic.com/1z6rtjm.png

    Categories are:
    League Tables, Match Photos, Match Report, News, Slider, Supporters Club Notes
    which is a secondary menu.

    The category I want to hide from the secondary menu is Slider. As I need that tag for the featured image.

    The primary menu is Contact Us, Stadium Info, Club History etc. at the top. If it helps, I am using TodaysNews from Fthemes.com

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    We need to know what PHP code you are using to list categories in your theme.

  5. padraigstapleton
    Member
    Posted 3 years ago #

    I'm new to WordPress, which .php file in Appearance -> Editor do you need?

  6. padraigstapleton
    Member
    Posted 3 years ago #

    Not sure if this helps?

    menu-primary.php
    [Code moderated as per the Forum Rules. Please use the pastebin]

  7. padraigstapleton
    Member
    Posted 3 years ago #

    menu-primary.php
    http://pastebin.com/mh2fQVpZ

    menu-secondary.php
    http://pastebin.com/2PCEkszT

  8. esmi
    Forum Moderator
    Posted 3 years ago #

    Try changing <?php wp_list_categories('depth=' . $theme->get_option('menu_secondary_depth') . '&hide_empty=0&orderby=name&show_count=0&use_desc_for_title=1&title_li='); ?> to<?php wp_list_categories('depth=' . $theme->get_option('menu_secondary_depth') . '&hide_empty=0&orderby=name&show_count=0&use_desc_for_title=1&title_li=&exclude=N'); ?>` where N is the id of your Slider category.

  9. padraigstapleton
    Member
    Posted 3 years ago #

    thank you, what line is that appearing on? I can't seem to find it.

    And it's on menu-secondary.php isn't it?

    I take it I delete the 'N' and replace it with 'Slider' which is the category I don't want in the secondary menu...

    Sorry if I'm being a bit slow with understanding the instructions.

  10. esmi
    Forum Moderator
    Posted 3 years ago #

  11. padraigstapleton
    Member
    Posted 3 years ago #

    Yes, we got there, thank you so much! Another few questions, i'll start up a new thread, much appreciated!

Topic Closed

This topic has been closed to new replies.

About this Topic