Title: WP_Query Taxonomy Parameters
Last modified: August 21, 2016

---

# WP_Query Taxonomy Parameters

 *  Resolved [Ricardo Gonçalves](https://wordpress.org/support/users/brgweb/)
 * (@brgweb)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/wp_query-taxonomy-parameters/)
 * I am trying to query a custom post type but it is not working.
 * I am using Elegant Theme’s Nexus with All in One Event Calendar.
 * The theme has a featured slider in the home page that gets the recent posts from
   a regular post category and displays it as slides. I want it to get the recent
   events from AIO Event Calendar, that are saved as a specific post type and display
   as slides.
 * The original code for the featured slider in the homepage is:
 *     ```
       <?php
       	$i = 1;
   
       	$featured_args = array(
       		'posts_per_page' => is_category() ? 2 : 4,
       		'cat'            => (int) get_catId( ( is_category() ? get_query_var( 'cat' ) : et_get_option( 'nexus_feat_posts_cat' ) ) ),
       	);
   
       	if ( is_category() ) {
       		$sticky_posts = get_option( 'sticky_posts' );
   
       		if ( is_array( $sticky_posts ) ) {
       			$featured_args['post__in'] = $sticky_posts;
       		} else {
       			$featured_args['orderby'] = 'rand';
       		}
       	}
   
       	$featured_query = new WP_Query( apply_filters( 'et_featured_post_args', $featured_args ) );
       ?>
       ```
   
 * I changed the $featured_args like this:
 *     ```
       <?php
       	$i = 1;
   
       	$featured_args = array(
       		'posts_per_page' => is_category() ? 2 : 4,
       		/*'cat'            => (int) get_catId( ( is_category() ? get_query_var( 'cat' ) : et_get_option( 'nexus_feat_posts_cat' ) ) ),*/
       		'post_type' => 'AI1EC_POST_TYPE'
       	);
   
       	if ( is_category() ) {
       		$sticky_posts = get_option( 'sticky_posts' );
   
       		if ( is_array( $sticky_posts ) ) {
       			$featured_args['post__in'] = $sticky_posts;
       		} else {
       			$featured_args['orderby'] = 'rand';
       		}
       	}
   
       	$featured_query = new WP_Query($featured_args ) );
       ?>
       ```
   
 * But nothing is showing in the slider anymore.
 * What am I doing wrong?
 * The nexus theme: [http://www.elegantthemes.com/demo/?theme=Nexus](http://www.elegantthemes.com/demo/?theme=Nexus)
   
   All in One Event Calendar: [http://wordpress.org/plugins/all-in-one-event-calendar/](http://wordpress.org/plugins/all-in-one-event-calendar/)
 * The site that I am trying to do this: [http://brgweb.com.br/ibmundial](http://brgweb.com.br/ibmundial)
 * Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/wp_query-taxonomy-parameters/#post-4646211)
 * AI1EC_POST_TYPE is not a string, it is a constant, so it does not belong in quotes.
   Use this: `'post_type' => AI1EC_POST_TYPE`
 *  Thread Starter [Ricardo Gonçalves](https://wordpress.org/support/users/brgweb/)
 * (@brgweb)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/wp_query-taxonomy-parameters/#post-4646348)
 * Thank you [@bcworkz](https://wordpress.org/support/users/bcworkz/). It worked
   perfectly!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘WP_Query Taxonomy Parameters’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [Ricardo Gonçalves](https://wordpress.org/support/users/brgweb/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/wp_query-taxonomy-parameters/#post-4646348)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
