WordPress.org

Ready to get started?Download WordPress

Forums

Setting Max Number of Top Level links in Link Menu (4 posts)

  1. sputnick3k
    Member
    Posted 3 years ago #

    I need to limit the number of links a user can apply to the top level of the navigation. I want them to go up to only five but there is no built in way to limit this. You can limit the depth but not the amount. The sub nav can be any length.

    This is what I have:

    <?php
                $nav_menu = wp_nav_menu( array(
                    'menu'			=> 'Top Nav',
                    'depth'			=> 3,
                    'menu_class'    => 'navigation dropdown',
                    'container'		=> ''
                )); ?>

    Can anyone help?

  2. dizee
    Member
    Posted 3 years ago #

    I need to know how to do this also...

  3. sputnick3k
    Member
    Posted 3 years ago #

    Ok my programmer friend wrote this and it works for me. maybe you can get this to work for you.

    [Code moderated as per the Forum Rules. Please use the pastebin]

  4. sputnick3k
    Member
    Posted 3 years ago #

    Ok lets try this again. This works:

    <iframe src="http://pastebin.com/embed_iframe.php?i=f282yWEi" style="border:none;width:100%"></iframe>

Topic Closed

This topic has been closed to new replies.

About this Topic