WordPress.org

Ready to get started?Download WordPress

Forums

subpage menu order (12 posts)

  1. jko170
    Member
    Posted 8 years ago #

    How do I set the subpage links in the order I want?

    http://www.kosbba.com/about/

    I've tried specifying the page order option but it doesn't do anything.

    Thanks, in advance.

  2. Joshua Sigar
    Member
    Posted 8 years ago #

    Is your code something like this?
    <?php wp_list_pages('childof=5&sort_column=menu_order&title_li='); ?>

    Template Tags/wp_list_pages

  3. jko170
    Member
    Posted 8 years ago #

    This is what I have on the sidebar.php

    <div class="sb_pagemenu"><h2><?php echo $parent_name; ?> Subpages</h2>

    <ul>
    <?php wp_list_pages('title_li=&child_of='. $parent_id); ?>
    </ul>
    </div>

  4. Joshua Sigar
    Member
    Posted 8 years ago #

    Your code does not pass the parameter "sort_column"

  5. jko170
    Member
    Posted 8 years ago #

    what should I change it to?

  6. Joshua Sigar
    Member
    Posted 8 years ago #

    <?php wp_list_pages('sort_column=menu_order&title_li=&child_of='. $parent_id); ?>

  7. jko170
    Member
    Posted 8 years ago #

    it seems to be working now, Thanks a lot !!

  8. geocliff
    Member
    Posted 7 years ago #

    I am having the same problem as jk0170, above: Subpages do not sort properly. Here is the code I have no doubt botched up in sidebar.php modifying the wp-list-pages function.

    <?php
    /* Uncomment this section if you need to have more page navigation than the top
    navigation bar allows. You'll still be able to have a few of the default
    pages appear at the top (the one's that the Blix theme excludes by default).
    **
    ?>
    <h2><em>Pages</em></h2>
    <ul class="pages">
    <?php
    $excluded = my_excluded_pages();
    wp_list_pages('title_li=&sort_column=menu_order&title_li=&child_of='. $parent_id);
    ?>

    In addition I have updated widgets.php, again modifying the wp-list-pages function:

    //////////////////////////////////////////////////////////// Standard Widgets
    function widget_pages($args) {
    extract($args);
    $options = get_option('widget_pages');
    $title = empty($options['title']) ? __('Pages') : $options['title'];
    echo $before_widget . $before_title . $title . $after_title . "<ul>n";
    wp_list_pages("title_li=&sort_column=menu_order");
    echo "</ul>n" . $after_widget;

    Obviously, I have no idea what I'm doing. Will anyone please help!?

    Thanks!

  9. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    Obviously, I have no idea what I'm doing.

    Obviously. ;)

    Your tags around the code are not correct. Look at this bit of code:
    <?php
    $excluded = my_excluded_pages();
    <strong>wp_list_pages('title_li=&sort_column=menu_order&title_li=&child_of='. $parent_id);</strong>
    ?>

    The <?php and ?> tags are supposed to surround all PHP code. But they can *ONLY* surround PHP code, they can't surround HTML code. So that strong tag you have there is horking things up.

    It should be like this instead:
    <?php $excluded = my_excluded_pages(); ?>
    <strong>
    <?php wp_list_pages('title_li=&sort_column=menu_order&title_li=&child_of='. $parent_id); ?>
    </strong>

    See the difference? The PHP bits are in the <? tags, the non PHP bits are not.

  10. geocliff
    Member
    Posted 7 years ago #

    Wow, that reply was fast!

    Sorry, Otto42. I'm new to this forum (any forum!). The purpose of the Strong tags was to emphasize a line of code to the reader of the post. They are not actually in the code.

    Would you be kind enough to have another look? I've updated the "horked-up" post. :)

    Thanks!

  11. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    Well, there isn't anything else obviously wrong with it. So, no idea.

  12. geocliff
    Member
    Posted 7 years ago #

    OK, thanks for looking.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.