Title: query_posts
Last modified: August 19, 2016

---

# query_posts

 *  [14ner](https://wordpress.org/support/users/14ner/)
 * (@14ner)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/query_posts-4/)
 * I am currently using:
 *     ```
       <?php	if (post_type_exists('athlete')) {
                     query_posts(array( 'post_type'=>'athlete', 'showposts'=>-1, ));
                   }
                   while ( have_posts() ) : the_post();
                       $data = get_posts();?>
       				<h4> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
                   <?php endwhile; ?>
       ```
   
 * To pull a list of all of the “Athlete” posts onto a page.
 * What I would like to do is sort by last name which I currently have set up as
   a metabox field called “athlete_lname” and then display the athletes name in 
   a two column list on the page.
 * The theme currently has css setup for two columns “two-col1” and “two-col2”
 * Thanks in advance for anyone’s help on this,
 * 14ner

The topic ‘query_posts’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 0 replies
 * 1 participant
 * Last reply from: [14ner](https://wordpress.org/support/users/14ner/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/query_posts-4/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
