WordPress.org

Ready to get started?Download WordPress

Forums

Sub Child Pages - Jump Menus (1 post)

  1. canofpopcom
    Member
    Posted 3 years ago #

    Hi guys.. i'm wondering if anyone could point me in the right direction.

    I'm trying to create a menu system as such..

    <menu>
    <parent>Parent Page</parent>
    <title>Subpage</title>
    <jump_menu>Subpage children</jump_menu>

    <title>Subpage</title>
    <jump_menu>Subpage children</jump_menu>

    <title>Subpage</title>
    <jump_menu>Subpage children</jump_menu>
    </menu>

    While I can get the subpages to display with their children using this lovely peice of code..

    <form action="<?php bloginfo('url'); ?>/" method="get">
    					<?php
    					if($post->post_parent)
    					$select = wp_dropdown_pages("sort_column=menu_order&selected=".$post->ID."&title_li=&child_of=".$post->post_parent."&echo=0");
    					else
    					$select = wp_dropdown_pages("title_li=&child_of=".$post->ID."&echo=0");
    					$select = preg_replace("#<select([^>]*)>#", "<select$1 onchange='return this.form.submit()'>", $select);
    					echo $select;
    					?>
    					</form>

    I can't seem to seperate out the child pages of the subpages..

    I thought about creating two arrays but these seems overly complicated..

    Anyone else done something similar on a theme or project that could point me in the correct direction.

Topic Closed

This topic has been closed to new replies.

About this Topic