WordPress.org

Ready to get started?Download WordPress

Forums

Query Post Order (6 posts)

  1. wireframe74
    Member
    Posted 4 years ago #

    Hi I have a query post on a page located here
    Roplay

    It retrieves child pages of a page that acts as a filter with the query post function..

    Am using flutter for the custom fields..

    There is a problem however as I do not seem to be able to sort the order of entries..

    I cant seem to find a plugin that can sort the order of pages with query post function..

    Is there a a way in which I can use flutter for this?

    Or am i best off recreating downloads in correct order..

    Thanks

  2. vtxyzzy
    Member
    Posted 4 years ago #

    You should be able to modify the sort using a filter, but without more detail, it is not possible to be specific.

    What is your query? How would you like it sorted?

  3. wireframe74
    Member
    Posted 4 years ago #

    Hi Here is a look at my loop..I have used the page order area within WP Cpanel to control order in conjunction with this from the 'orderby' => 'menu_order' parameter.. Here is code:

    <?php // START LOOP FOR ROPLAY BALL DOWNLOADS  ?>
    
    <h2>Roplay Ball Data Sheet Downloads</h2>
    <?php
    query_posts(array('showposts' => 100, 'post_parent'=> 47, 'post_type' => 'page', 'orderby' => 'menu_order'));
    while (have_posts()) {
    the_post();
    ?>
    
    <a href="<? echo get('file'); ?>" target="_blank"><?php the_title(); ?></a><br />
    
    <?php }
    
    wp_reset_query(); //Restore Global Post data
    
    ?>
  4. wireframe74
    Member
    Posted 4 years ago #

    I got it:

    'orderby' => 'menu_order', 'order'=>'ASC'

    Just added these filters to query post function..Needed the additon of 'order' => 'ASC'

  5. wireframe74
    Member
    Posted 4 years ago #

    Thx for advice..much appreciated!

  6. vtxyzzy
    Member
    Posted 4 years ago #

    Glad you got it! Now, please use the dropdown at top right to mark this topic 'Resolved'.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.