/** * Redirect video search to the appropriate template * * @access public * @param object $query * @return void */ function wolf_redirect_video_search() { if (wolf_is_video_search()) { wolf_videos_get_template('search-videos.php'); exit; } }
/** * Handle redirects before content is output - hooked into template_redirect so is_page videos. * * @access public * @return void */ function wolf_videos_template_redirect() { if (is_page(wolf_videos_get_page_id())) { wolf_videos_get_template('videos-template.php'); exit; } }
/** * Output the end of a ticket loop. By default this is a UL * * @access public * @return void */ function wolf_videos_loop_end($echo = true) { ob_start(); wolf_videos_get_template('loop/loop-end.php'); if ($echo) { echo ob_get_clean(); } else { return ob_get_clean(); } }
?> <span class="trigger-spinner"></span> </span> </div> <?php } ?> <?php } ?> <?php } else { ?> <?php wolf_videos_get_template('loop/no-video-found.php'); ?> <?php } // end have_posts() check ?> </div><!-- .video-container --> <?php if (!wolf_get_theme_option('video_infinite_scroll_trigger')) { /** * Pagination */ if (wolf_get_theme_option('video_infinite_scroll')) { wolf_paging_nav($loop); }
/** * Shortcode * * @param array $atts * @return string */ public function shortcode($atts) { extract(shortcode_atts(array('count' => 3, 'category' => null, 'col' => $this->get_option('col', 3)), $atts)); ob_start(); $args = array('post_type' => array('video'), 'posts_per_page' => absint($count)); if ($category) { $args['video_type'] = $category; } $loop = new WP_Query($args); if ($loop->have_posts()) { ?> <div class="shortcode-video-grid video-grid-col-<?php echo absint($col); ?> "> <?php while ($loop->have_posts()) { $loop->the_post(); ?> <?php wolf_videos_get_template_part('content', 'video-shortcode'); ?> <?php } ?> </div><!-- .shortcode-videos-grid --> <?php } else { // no video ?> <?php wolf_videos_get_template('loop/no-video-found.php'); ?> <?php } wp_reset_postdata(); $html = ob_get_contents(); ob_end_clean(); return $html; }