• hi,

    i have serious problem here and it would be awesome if somebody could give me a little advice.

    at https://www.wds-institut.de/test/ i use a horizontal page navigation. but when you click on a sub page link, the sub page navigation disappears.

    i use this for the main row:
    <?php wp_list_pages(‘exclude=3,4,5,26,27&title_li=&sort_column=menu_order&depth=1’); ?>

    and this for the sub row:
    <?php wp_list_pages(“exclude=25,14,15,17,18,19&child_of=$post->ID&depth=2&title_li=&sort_column=menu_order”); ?>

    thanks
    frank

Viewing 6 replies - 1 through 6 (of 6 total)
  • I’m not sure why this is happening but I did notice something that seems to be wrong with the permalinks here. When I click the like for “Philosophie,” the permalink looks like this: https://www.wds-institut.de/test/?page_id=9.

    Notice the page number? However, when I click a sub-page from there, such as Unternehmen BRD, the link just looks like this: https://www.wds-institut.de/test/. In other words, there is no permalink there.

    I clicked through these links because I noticed that in the codes above, you have certain pages excluded, and I was wondering what pages those ID numbers belonged to. It sounds like a stupid question, but are you *sure* you aren’t excluding the nav menu from those sub-pages?

    (I couldn’t tell because, as I said, I’m not getting a page ID when I click on a sub-page link).

    Thread Starter dexter

    (@dexter)

    oh sorry o forgot to say that i am using a plugin to define a page as startpage. this is the Unternehmen BRD page.

    i am pretty sure that child_of=$post->ID is the problem here. because the clicked childpage has no own child pages, so there can’t be a navigation for child pages.

    unfortunately my php skills are very weak to find a solution. maybe it needs just a little “if… then…” action.

    Okay, so then can you tell me if the pages excluded in the second bit of code (numbers 25,14,15,17,18 and 19) are sub-pages? What happens if you take that “exclude” parameter out of that code?

    Thread Starter dexter

    (@dexter)

    i have a couple subpages, which i dont wanna show in this sub navigation. if i would take out the exclude tag you could see these pages listed in the navigation.

    So what happens when you try just this:
    <?php wp_list_pages("exclude=25,14,15,17,18,19&depth=2&title_li=&sort_column=menu_order"); ?>

    or this:
    <?php wp_list_pages("exclude=25,14,15,17,18,19&title_li=&sort_column=menu_order"); ?>

    Thread Starter dexter

    (@dexter)

    thanks.
    but this displays just the whole navigation structure without the excluded pages.

    is there a way to use this child_of=$post->ID to display child pages of a certain page?

    like this child_of=$post->8
    Means writing a number instead of ID.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘horizontal page navigation sub pages’ is closed to new replies.