Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Need a Wordpress Expert - Help!

  • 28-08-2009 9:00am
    #1
    Moderators, Motoring & Transport Moderators, Music Moderators Posts: 12,781 Mod ✭✭✭✭


    Hey guys, I'm hoping someone can help me out with a really annoying problem i'm having. I just built a new site using wordpress. Coming along great apart from one small thing I'm trying to do.

    Basically, I wanted to create some separate static pages – but I did not want them on the top menu. Currently if I page a new static page, whether it is a ‘parent’ or a ‘child’ – it still gets its own link on the top navigation bar.

    So, I found a plugin called “Exclude Pages” which gives you a little tickbox when writing a page, and if you untick it, the page does not get linked to any navigation. Perfect! Worked great until I started adding static pages. I need about 8. I added the first few and it worked grand, but then when I came to number 4 or so, it started doing something really weird. For every page I added which I excluded from the navigation, the menubar at the top would shrink! It would remove one of the links. I have no idea why.

    So the menu at the top had 7 links, when I added 3 non-linked static pages, the navigation at the top would only show manu links 1-4! It’s so weird! If I get the static pages and make them all “Drafts” instead of “Published” – my menu goes back to normal. It’s so strange.

    Would anyone please be able to look at this for me? Drop me a pm if you want to take a look

    Or is there an easier way to make pages that are not linked to the menu? Even if I could set it so that any "Child" pages are not linked, but "Parents" are, that would be perfect.

    Thanks a mil for your help!


Comments

  • Registered Users, Registered Users 2 Posts: 213 ✭✭Hoku


    The page exclusion feature is built into Wordpress by default, you just have to use the dynamic sidebar for it.

    Alternatively, you could alter header.php so that only the top-level pages are shown, and all child pages are excluded.


  • Moderators, Motoring & Transport Moderators, Music Moderators Posts: 12,781 Mod ✭✭✭✭Zascar


    Thanks! I don't think my theme has a dynamic sidebar... not sure

    Option two sounds great, how do I do it?
    Thanks a mil!
    Z


  • Registered Users, Registered Users 2 Posts: 213 ✭✭Hoku


    Open up the header.php file either through the Dashboard (Appearance -> Editor) or via FTP.

    Look for
    [PHP]<?php wp_list_pages ( .... ); ?>[/PHP]

    Now again, you have 2 options:

    1) You can exclude ALL child pages by adding a 'depth=1' argument (this is probably the easier of the two)

    Or

    2) You can create a page and then assign all other pages as a Child to this one, and then add the 'exclude_tree=[page id here]' argument
    To get the page ID, hover your cursor over the created page in the Dash, and you'll see the ID in the status bar (or click it and then you'll see it in the address bar)


    In the end, your function will look something like this:
    [PHP]<?php wp_list_pages ('title_li=&depth=1&exclude_tree=17'); ?>[/PHP]


  • Moderators, Motoring & Transport Moderators, Music Moderators Posts: 12,781 Mod ✭✭✭✭Zascar


    Thanks so much to Hoku for fixing it for me.
    it was the template limitng the amount of Pages in the menu, whether child or not. Doh!
    :D


Advertisement