Take the 2-minute tour ×

I am using the GamePress theme, which has a custom Taxonomy/Post type for videos. When using the built-in Nivo Slider, it displays all videos, rather than the ones put into the "Featured" category.

Inside of the slider's PHP code, there are a few lines responsible for grabbing the videos out of the video taxonomy.

$vid_term_ids = array();                    
$vid_tax = get_terms( 'gamepress_video_category' );
foreach ($vid_tax as $term) :
  $vid_term_ids[] = $term->term_id;

if ( in_array( $cat, $vid_term_ids ) ) :

  $wp_query = new WP_Query( array(
    'posts_per_page' => $limit
    'post_type'      => 'gamepress_video',
    'tax_query'      => array(
       'taxonomy'       => 'gamepress_video_category',
       'field'          => 'id',
       'terms'          => $cat
  ) );


What I would like to do is modify the code so that it only displays videos placed in the "Featured" category inside of gamepress_video_category rather than display every video in the taxonomy.

I am not skilled at PHP, but I do fare well in Java and a handful of other languages. How would I go about using get_terms() to grab videos in the "Featured" video category?

Or am I going about this all wrong?

share|improve this question

Your Answer



Browse other questions tagged or ask your own question.