Skip to content

Instantly share code, notes, and snippets.

@yllus
Created November 14, 2014 17:15
Show Gist options
  • Select an option

  • Save yllus/d1f3e7a6914a9bdca112 to your computer and use it in GitHub Desktop.

Select an option

Save yllus/d1f3e7a6914a9bdca112 to your computer and use it in GitHub Desktop.
// Get term ID for the video category.
$video_category_term = get_term_by('slug', 'video-landing-page', 'video-categories');
$video_category_term_id = $video_category_term->term_id;
// Find the bc-video-strip post associated to that video category.
$strip_query = new WP_Query(
array(
'post_type' => 'bc-video-strip',
'tax_query' => array(
array(
'taxonomy' => 'video-categories',
'field' => 'term_id',
'terms' => $video_category_term_id,
'include_children' => true
),
),
)
);
// Get the postmeta for the bc-video-strip post.
$attached_strips_raw = get_post_meta($strip_data_post_id);
// Get the display show page or not value.
$display_as_show_page = (boolean) $attached_strips_raw['bc-is-show-page'][0];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment