WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Using Pages links for navigation (5 posts)

  1. ShizzlePDX503
    Member
    Posted 7 years ago #

    I am using a customized version of the juicy-1.0 theme for wordpress and I changed the header to not display the pages and instead put this in my sidebar via:

    <h2>Navigation</h2>
       <ul><li class="page_item">
       <a href="<?php bloginfo('url'); ?>/"><?php _e('Home'); ?></a></li>
       <?php wp_list_pages('title_li=' . __('')); ?></ul>

    I am wondering how can I make it so that it doesn't display them in what seems to be alphabetical order. Instead I would like them to be display in post id order so that I can put them in a specific order that is to my liking.

    I haven't used wordpress as my site content before but other than this small thing I really like using wp rather then the phpnuke stuff that I was using prior

    Thanks for the help!

  2. pramodd
    Member
    Posted 7 years ago #

    I think you should use the get_pages() function to retrieve pages by id.

  3. sarasaratricecom
    Member
    Posted 7 years ago #

  4. ShizzlePDX503
    Member
    Posted 7 years ago #

    alright so I took an idea from that plugin. I tried the plugin first then I found another way of doing the same thing. You still have to use the order pages to put them in order or what I did was use the database to do the same thing. then I put this code in the sidebar:

    <?php wp_list_pages("title_li=&depth=1&sort_column=menu_order");?>

    now if I could figure out how to display the sub pages on the parent page. Like how would I go about displaying the links to sub pages on the parent page?

  5. amucklow
    Member
    Posted 6 years ago #

    This, I believe, is how you do that:

    <?php
    global $wp_query;
    if( empty($wp_query->post->post_parent) ) {
    $parent = $wp_query->post->ID;
    } else {
    $parent = $wp_query->post->post_parent;
    }
    wp_list_pages("title_li=<h2>IN THIS SECTION</h2>&child_of=$parent&sort_column=menu_order&show_date=modified&date_format=$date_format"); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic