• Resolved radke-1

    (@radke-1)


    Hey i’m new to this whole WordPress thing, so i’m finding it a little confusing…

    I’m having problems with the links.

    I’ve got the main bar at the top sorted out, but i wanted one of these parent pages to include links to my other pages. But whenever i make a new page, it shows on the main page. I don’t want them displayed on there.

    How do i do it?

    (I’m only 16 so keep it as simple as you can haha)

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter radke-1

    (@radke-1)

    Ahh i still don’t get it. I know how to make lists and how to exclude a link from it…but it’s whenever i make a new page, it floats on the top of my site.

    Site:
    http://www.livemusic-uk.com

    Sorry, i’m really new to this. >.<

    Are any of the pages currently showing on your top nav menu children? Or are they all top-level Pages?

    Thread Starter radke-1

    (@radke-1)

    The one that says ‘Slipknot’ is the one that i’m not wanting shown on the main page. It was just supposed to be a page that’s linked in the ‘Artists’ section.

    But it’s only giving me the option to make it a parent, which puts it on the nav menu, or a child of one of those pages, so i put Artists and it’s just done what it’s like now on the page. xD

    Edit your nav bar template file (perhaps header.php or sidebar.php?) and look for <?php wp_list_pages();?>. In the list of parameters inside the brackets, add &depth=1. That will limit the top nav to just showing top-level page links.

    http://codex.wordpress.org/Template_Tags/wp_list_pages

    Thread Starter radke-1

    (@radke-1)

    I’ve looked in all the theme files and it doesn’t have the wp_list_pages…but i have this thing here:

    wp_page_menu)’show_home=0&sort_column=menu_order, post_title&link_before=&link_after='(;

    Is that similar?

    Almost – except it lacks the ‘depth’ parameter needed to exclude child pages. On the plus side, it allows you to exclude a static home page link from the menu (show_home=0)

    http://codex.wordpress.org/Template_Tags/wp_page_menu

    You could try replacing it with wp_list_pages('title_li=&sort_column=menu_order&depth=1')

    If a home page link does appear, grab the id of that home page and then use the ‘exclude’ parameter to hide it – eg. wp_list_pages('title_li=&sort_column=menu_order&depth=1&exclude=2')

    Thread Starter radke-1

    (@radke-1)

    I put in the code wp_list_pages(‘title_li=&sort_column=menu_order&depth=1’) and it’s done something…haha, well it’s got rid of the Slipknot button, but the nav bar’s been turned into a list of the pages instead.

    http://www.livemusic-uk.com

    Try

    <div class="menu"><ul>
    <?php wp_list_pages('title_li=&sort_column=menu_order&depth=1&exclude=2');?>
    </ul></div>

    Thread Starter radke-1

    (@radke-1)

    Hey it worked! Thanks for your help, it means a lot. 🙂 x

    I’m working with the Sandbox theme and I found that editing the global nav code in the functions.php code did the trick-

    function sandbox_globalnav() {
    	if ( $menu = str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages('title_li=&sort_column=menu_order&echo=0&depth=1') ) )

    all I did was add the &depth=1 and it seems to work now…

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘How can i hide these links?’ is closed to new replies.