Don't show Subpages on Menu Bar

Discussion in 'Nutrition WordPress Theme' started by sebastian_stier, Nov 5, 2012.

Thread Status:
Not open for further replies.
  1. sebastian_stier

    sebastian_stier New Member

    Joined:
    Oct 19, 2012
    Messages:
    2
    Likes Received:
    0
    Hello everybody,

    I've started making my webpage with the Nutrition Theme.

    I have two pages that I don't want to have listed on the menu bar - nor listed as subpages or submenus on the menu bar. How do I set this up? I've already looked into the Theme Options, but couldn't find any hints...

    Thanks,
     
  2. sebastian_stier

    sebastian_stier New Member

    Joined:
    Oct 19, 2012
    Messages:
    2
    Likes Received:
    0
    Well, I've finally made it by my own. In case you want to know, here is the how to:

    DO NOT TRY THIS IF YOU DON'T UNDERSTAND WHAT YOU ARE DOING (I know a little of php...) - I wasn't able to find a "user friendly" way.

    NOTICE: You may trash your site if you make a mistake and don't know much about editing PHP theme files. In case you want to try it out anyway, make sure can access your server via FTP and make sure you know where the file is that you are editing. Make a back up to your computer and start editing on the Wordpress editor. If you happen to trash your site, just upload the backed up file from our computer to the FTP server, replacing the one on the server. If you don't know what I mean, then just leave it and look for somebody who may be able to help you.

    In the Theme Editor, I opened inkthemes-functions.php
    Then, I've added the attribute "depth=1" in two different places:

    First at Line 35:
    wp_nav_menu(array('theme_location' => 'custom_menu', 'container_id' => 'menu', 'menu_class' => 'ddsmoothmenu', 'fallback_cb' => 'inkthemes_nav_fallback', 'depth'=>1));

    Then at line 45, just to make sure:
    wp_list_pages('title_li=&show_home=1&sort_column=menu_order&depth=1');

    And now my main menu only shows one level of hierarchy. Needles to say, you can use the depth attribute to change the hierarchy levels to be shown just by changing the number (1 means just the top, 2 means the top and their children, and so on - 0 means all levels of hierarchy).


    Hope I can help somebody.
     
Thread Status:
Not open for further replies.

Share This Page