WordPress.org

Ready to get started?Download WordPress

Forums

code modification "order by title" (4 posts)

  1. sarkishage
    Member
    Posted 1 year ago #

    Please i need help i have a page portfolio with this code

    if($post->post_parent) {
    $children = wp_list_pages('sort_column=menu_order&title_li=&child_of=' . $post->post_parent . '&depth=1&echo=0');
    }
    else {
    $children = wp_list_pages('sort_column=menu_order&title_li=&child_of=' . $post->ID . '&depth=1&echo=0');
    }

    This code show me the portfolio post in the page in the order of post date.. how i can get it by order of post title?? Please help

  2. shastaw
    Member
    Posted 1 year ago #

    You're looking for this page in the codex: http://codex.wordpress.org/Function_Reference/wp_list_pages

    Specifically, check the section about sort_column Sounds like you want post_title instead of menu_order.

  3. sarkishage
    Member
    Posted 1 year ago #

    Thank you shastaw for your help.. i am trying it i think this is useful ;)
    I will tell you the result.. thx

  4. sarkishage
    Member
    Posted 1 year ago #

    Sadly nothing change in my theme :S not even by ID or anything else!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.