WordPress.org

Forums

menu order (4 posts)

  1. davidandre
    Member
    Posted 5 years ago #

    Hi everybody!

    i am having a problem with my menu order. i ve got a vertical list:
    item1
    item2
    item3

    and i would like that ,when i click on the item 2 for example,
    the menu order becomes (on the page onthe items2):
    item2
    item1
    item3

    and not:"sort_column=menu_order"

    here is my code:

    <?php if ( is_page() ) {

    if($post->post_parent)

    $children = wp_list_pages('sort_column=menu_order&title_li=&child_of='.$post->post_parent.'&echo=0');

    else

    $children = wp_list_pages('sort_column=menu_order&title_li=&child_of='.$post->ID.'&echo=0');

    if ($children) {

    ?>

    <div class="sidebar">

    <h2>prueba</h2>

    <ul id="sub">

    <?php echo $children; ?>

    </div>

    <?php

    } // End If Post
    } // End if is page

    ?>

    what could i change to get the result i am lloking for?

    thanks a lot for your help!i need it:)i am trying for a while without solution...

    cheers,
    David

  2. Shane G.
    Member
    Posted 5 years ago #

  3. davidandre
    Member
    Posted 5 years ago #

    hi Shane!
    thanks alot,
    i ll check it and let you know,
    cheers.really appreciate

  4. davidandre
    Member
    Posted 5 years ago #

    Hi Everybody!
    i tried this two plugins but not really what i am loking for..anyway thanks a lot for your answer Shane!always nice.
    I don t need to rearrange my menu order from the backend, but i would like a dinamic menu in function of the page.
    if i am on the page 1:
    item 1
    item2
    item 3

    if i am on the page 2:
    item2
    item1
    item3...

    and so...

    my code:
    <?php if ( is_page() ) {

    if($post->post_parent)

    $children = wp_list_pages('sort_column=menu_order&title_li=&child_of='.$post->post_parent.'&echo=0');

    else

    $children = wp_list_pages('sort_column=menu_order&title_li=&child_of='.$post->ID.'&echo=0');

    if ($children) {

    ?>

    <div class="sidebar">

    <h2>prueba</h2>

    <ul id="sub">

    <?php echo $children; ?>

    </div>

    <?php

    } // End If Post
    } // End if is page

    ?>
    i know the problem is `sort_column=menu_order" but don t find any tag which can fix my problem! any idea???

    sorry if my english is not that clear.(not my language)

    thanks alot,

    David

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags