Support » Fixing WordPress » Query Custom Post Type

  • Hi Everyone,

    I am currently building a hall of fame site. I created a custom post type for the athletes. Then I created a custom page template called Athletes where I would like to display a list of all of the athletes.

    Here is my question:

    I would like to query links to the athletes into two columns. I have a custom meta box with the athletes name so I would also like to use that field to sort the athletes alphabetically. Also the number of athletes is always changing so some way the query would need to first count the number of post and then divide by two.

    Any help is appreciated.

    14ner

Viewing 2 replies - 1 through 2 (of 2 total)
  • here is an example of a query of a page i am working on right now:
    $wp_query->query('&paged='.$paged&meta_key=fb_count&order=DESC&orderby=meta_value_num');

    The custom field is the meta_key, in my example above it is fb_count and it orders is DESC which is highest to lowest. You should change orderby=meta_value_num to orderby=meta_value

    Thanks for the help.

    The code above doesn’t seem to be working though.

    -14ner

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Query Custom Post Type’ is closed to new replies.