• Resolved drumz

    (@drumz)


    I cannot get the custom menu to work right. I created pages and copied their URL and made them private which removed them from the main header menu (menu.php) they showed up in the left sidebar as wanted but clicking says page not found. So I made them all public so clicking on them (top nav only) worked but still, left side now does nothing, no page not found; except one that is using ?pageID but I am using date/name format so do not know where that came from (or is this a hint?). So then I added the exclude to the menu.php file like this:<?php wp_list_pages('exclude=birthday-party,djs,foam-parties,follow-us,hottie-of-night,join-our-text-list,pictures,throw-your-own-party,videos,vip-rental' ); ?> But the items are still on the top nav still and the links on the left don’t work. What is wrong?

Viewing 15 replies - 1 through 15 (of 26 total)
  • Thread Starter drumz

    (@drumz)

    Are the Pages in the left sidebar still set up as Private?

    Thread Starter drumz

    (@drumz)

    Yes. I tried playing around with ?pageID but still no go. The theme I based mine in does not support custom menus and that may be the issue. So I hard coded left-sidebar.php but no go. And when I use the custom menu it messes up the page layout when not using a hard coded leftsidebar/using custom menu.

    Have you tried soft-coding the links using wp_list_pages with the include parameter?

    Thread Starter drumz

    (@drumz)

    No but I tried using the exclude parameter in wp_list_pages and it didn’t exclude them in menu.php.

    Forget the top menu for now since you have that sorted. You need to try a second instance of wp_list_pages in your side bar (sidebar.php?) that specifically includes the Pages you want to display.

    Thread Starter drumz

    (@drumz)

    So using the include parameter will include them even though they are private? I’ll try it…

    But I will probably have the same problem with the layout as I did when trying to use the custom menu…

    But I will try it just the same and you can see it. Give me 10 minutes…
    Test site

    I made the changes but the layout is messed up and the links don’t work. Do I need to do a combination of exclude in menu.php and an include in leftsidebar?

    Thanks for your help, by the way.

    So using the include parameter will include them even though they are private?

    Yes – but they’ll still generate 404s unless the viewer is logged in. You need to change the status of all Pages that you want viewed by the general public to Public. Then use exclude and include with wp_list_pages to limit what is (or isn’t) displayed as appropriate.

    Thread Starter drumz

    (@drumz)

    So give it to me slow… I put an exclude in menu.php and an include in sidebar.php and make all the pages public? I did everything except the combo of include/exclude.

    Then why was it ignoring menu.php and (I hadn’t done an include in sidebar) before and messing up the layout?

    I put an exclude in menu.php and an include in sidebar.php and make all the pages public?

    Yes. menu.php should have something like:

    <?php wp_list_pages('title_li=&exclude3,5,7,9');?>

    whist sidebar.php would use:

    <?php wp_list_pages('title_li=&include3,5,7,9');?>

    Thread Starter drumz

    (@drumz)

    So you need both?
    And how about what custom-menu is doing to the layout?

    I really appreciate your help!

    So you need both?

    You do to achieve the two menus you want, yes.

    And how about what custom-menu is doing to the layout?

    I thought you couldn’t get custom menus working in this theme?

    Thread Starter drumz

    (@drumz)

    It says that in the CP that the theme doesn’t support it but if you look, you can see that it works but does some weirdness to the layout.
    Test site

    That looks like a standard wp_list_pages output to me – albeit with too many pages for the nav bar to handle. Have you actually set up a custom menu via Appearance -> Menus and then added this menu via the Custom Menu widget in Appearance -> Widgets?

    Thread Starter drumz

    (@drumz)

    I have the exclude in menu.php and the include in the sidebar.php and made them all public but as you can see the top nav is ignoring the exclude.
    Now the only thing I think that can be doing it is I used the filename url and not the the page ID URL so maybe the parameter only wants the page ID?

Viewing 15 replies - 1 through 15 (of 26 total)
  • The topic ‘Custom Menu links not working’ is closed to new replies.