Created
November 14, 2014 17:15
-
-
Save yllus/d1f3e7a6914a9bdca112 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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