Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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;
endforeach; 

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
    ),
  ) );

endif;

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.