Forums

[resolved] wp_page_menu and hiding grandchildren (3 posts)

  1. vectyr
    Member
    Posted 2 years ago #

    Ok this sounds like it should be basic but I can't seem to find a solution. I'm currently using wp_page_menu to show dropdown menus on my site. But I would only like to show the children of the main items only, so no grandchildren or great-grandchildren or third cousins twice removed.

    I don't know if there's an easy way to do this. One solution is to have the wp_page_menu only show a certain category and then put all the pages I want to show in that category. Any ideas?

  2. vectyr
    Member
    Posted 2 years ago #

    Crap, scratch the categories idea, nevermind on that. But hiding grandchildren...hmmm.

  3. vectyr
    Member
    Posted 2 years ago #

    <?php wp_page_menu('depth=2') ?>

    There's the solution. "depth=2" will only show the main menu items and their immediate children.

Topic Closed

This topic has been closed to new replies.

About this Topic