WordPress.org

Ready to get started?Download WordPress

Forums

Include parent page in the child-, possible? (9 posts)

  1. Valdemar
    Member
    Posted 2 years ago #

    Hi everyone!

    I'm making this website for a friend of mine. And.. He wanted a menu-structure I really can't make. I've tried with some regular expressions (preg_replace), but it wont work..

    The structure I want is:

    Parent page 1
    - Parent page 1
    - child page 1
    - child page 2
    - child page 3
    Parent page 2
    - Parent page 2
    - child page 1
    - child page 2

    And I'm using the wp_page_menu() function to output the menu.

    How to do this? I've tried changing the output with preg_replace, but maybe I'm just too stupid..

  2. Chip Bennett
    Theme Review Admin
    Posted 2 years ago #

    Can you describe, in human terms what you're trying to accomplish?

    I can't tell from your structure what you're actually trying to do. Are you trying to make a page a child of itself? Or are you merely trying to modify the page list output/display?

  3. Valdemar
    Member
    Posted 2 years ago #

    I'm sorry I couldn't describe it better. I would like to make a page a child of itself.

    I don't know if there's any easy way to do it, or if I have to use preg_replace() or whatever.

    I've searched a bit on google, but without luck. And I've tried using the php function preg_replace(), but my regular expression did not work well.

  4. Chip Bennett
    Theme Review Admin
    Posted 2 years ago #

    I would like to make a page a child of itself.

    There is no way for a page to define its own ID as post_parent. The sky would probably fall on your head if you tried. :)

    Another question: why do you need/want to make a page a child of itself? What, ultimately, are you trying to accomplish?

  5. Valdemar
    Member
    Posted 2 years ago #

    Haha :P Well.. Then I at least want to make it look like it's a child of itself.

    And why I want it so? Well.. The guy I'm making this website for, wanted every parent page to be children of themselves.

    Another example on the structure, if you're still in doubt:

    Homepage
    Animals
    - Animals
    - Birds
    - Lions
    - Elephants
    Funny Facts
    Great Buildings
    - Great Buildings
    - A Great Building
    - Another Great Building
    Contact me

  6. Chip Bennett
    Theme Review Admin
    Posted 2 years ago #

    Let me try to rephrase. :)

    Does the actual page structure need to be this way, or simply the navigation menu?

  7. Valdemar
    Member
    Posted 2 years ago #

    Just the navigation menu of course.. I'm sorry i wasn't precisely enough.
    I really appreciate that you're trying to help me, though it isn't easy. :)

  8. Chip Bennett
    Theme Review Admin
    Posted 2 years ago #

    Just the navigation menu of course

    Oh, well that's easy! :)

    Be sure that your Theme supports the core Navigation Menus feature, then just go to Dashboard -> Appearance -> Menus, and create a menu with whatever structure you want, and assign it to the desired Theme Location.

  9. Valdemar
    Member
    Posted 2 years ago #

    Oh! That's easy! Thanks!!

Topic Closed

This topic has been closed to new replies.

About this Topic