Title: Custom Post Types UI WP_QUERY
Last modified: August 20, 2016

---

# Custom Post Types UI WP_QUERY

 *  [pacior](https://wordpress.org/support/users/pacior/)
 * (@pacior)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/custom-post-types-ui-wp_query/)
 * Hello i have custom post types ui plugin installed. i have custom post type hotels
   and one of my custom taxonomy is named stars.
    i want to sort hotels by stars
   in the loop, but it doesn’t work. my code: ` $second_query = new WP_Query( array('
   post_type' => 'hotels', 'post_status' => 'publish', 'posts_per_page' => '16','
   orderby' => 'stars', 'order' => 'ASC', 'paged' => $paged ) ); while( $second_query-
   >have_posts() ) : $second_query->the_post(); (...)  it shows hotels but doesn’t
   order by stars. when i used var_dump($wp_query->request); it shows:  string(137)"
   SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND (wp_posts.ID = '2') AND wp_posts.
   post_type = 'page' ORDER BY wp_posts.post_date DESC "  custom post types are 
   editable in admin panel. Thanks in advance!

The topic ‘Custom Post Types UI WP_QUERY’ is closed to new replies.

## Tags

 * [custom post types ui](https://wordpress.org/support/topic-tag/custom-post-types-ui/)
 * [wp_query](https://wordpress.org/support/topic-tag/wp_query/)

 * 0 replies
 * 1 participant
 * Last reply from: [pacior](https://wordpress.org/support/users/pacior/)
 * Last activity: [14 years, 12 months ago](https://wordpress.org/support/topic/custom-post-types-ui-wp_query/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
