WordPress.org

Ready to get started?Download WordPress

Forums

Exclude a Category in menu (7 posts)

  1. Otenyano
    Member
    Posted 4 years ago #

    i want to exclude a category id on menu which is stored in variable
    for example i have a variable which is $catID = 12;

    how will i do it. this is my menu structure.

    <?php wp_list_categories('sort_column=menu_order&depth=3&title_li=&exclude='); ?>

  2. Roy
    Member
    Posted 4 years ago #

  3. Otenyano
    Member
    Posted 4 years ago #

    thank you, but its not what i want

  4. Roy
    Member
    Posted 4 years ago #

    Well I might misunderstand what you want to achieve, but that plugin allows you to exclude categories from a number of things, the index, the category menu.

  5. section300
    Member
    Posted 4 years ago #

    <?php wp_list_categories('sort_column=menu_order&depth=3&title_li=&exclude=PUT CATEGORY ID NUMBER HERE'); ?>

    for example lets say the category ID is 23:

    <?php wp_list_categories('sort_column=menu_order&depth=3&title_li=&exclude=23'); ?>

  6. batrachoid
    Member
    Posted 4 years ago #

    Your post is not very clear. What results do you want, exactly?

  7. MichaelH
    Member
    Posted 4 years ago #

    <?php
    wp_list_categories('sort_column=menu_order&depth=3&title_li=&exclude='. $catID);
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic