/** * Define the metabox and field configurations. * * @param array $meta_boxes * @return array */ function cmb_sample_metaboxes(array $meta_boxes) { // Start with an underscore to hide fields from custom fields list $prefix = 'cmb_'; $options = get_option('podcaster-theme'); $activepp_plugin = get_pod_plugin_active(); if (pod_theme_option('pod-featured-header-type') == 'static-posts' || pod_theme_option('pod-featured-header-type') == 'slideshow') { $meta_boxes[] = array('id' => 'thst_featured_post', 'title' => __('Featured Post', 'thstlang'), 'pages' => array('post', 'podcast'), 'context' => 'side', 'priority' => 'default', 'show_names' => true, 'fields' => array(array('name' => __('Feature Post', 'thstlang'), 'desc' => __('Tick the box to feature this post on the front page.', 'thstlang'), 'id' => $prefix . 'thst_feature_post', 'type' => 'checkbox'), array('name' => __('Featured Post Header', 'thstlang'), 'desc' => __('Upload an image or enter an URL.', 'thstlang'), 'id' => $prefix . 'thst_feature_post_img', 'type' => 'file', 'allow' => array('url', 'attachment')), array('name' => __('Alignment', 'thstlang'), 'desc' => __('Select the alignment of your header.', 'thstlang'), 'id' => $prefix . 'thst_feature_post_align', 'type' => 'select', 'options' => array(array('name' => __('Left', 'thstlang'), 'value' => 'text-align:left;'), array('name' => __('Center', 'thstlang'), 'value' => 'text-align:center;'), array('name' => __('Right', 'thstlang'), 'value' => 'text-align:right;'))), array('name' => __('Background Style', 'thstlang'), 'desc' => __('Choose how you would like to display the background image.', 'thstlang'), 'id' => $prefix . 'thst_page_header_bgstyle', 'type' => 'radio', 'options' => array(array('name' => __('Tiled', 'thstlang'), 'value' => 'background-size:contain;'), array('name' => __('Stretched', 'thstlang'), 'value' => 'background-size:cover;')), 'default' => 'background-size:cover;'), array('name' => __('Display Excerpt', 'thstlang'), 'desc' => __('Tick the box to display an excerpt.', 'thstlang'), 'id' => $prefix . 'thst_feature_post_excerpt', 'type' => 'checkbox'), array('name' => 'Excerpt Word Count', 'desc' => 'Enter the amount of words you want to display in your excerpt. Leaving it blank with default to 25 words.', 'id' => $prefix . 'thst_featured_post_excerpt_count', 'type' => 'text_small'), array('name' => __('Parallax', 'thstlang'), 'desc' => __('Tick the box to activate parallax.(Parallax is not supported if the slideshow is active.)', 'thstlang'), 'id' => $prefix . 'thst_feature_post_para', 'type' => 'checkbox'))); } if ($activepp_plugin != 'bpp' && $activepp_plugin != 'ssp') { $meta_boxes[] = array('id' => 'thst_featured_audio', 'title' => __('Featured Audio', 'thstlang'), 'pages' => array('post'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true, 'fields' => array(array('name' => 'Audio Type', 'id' => $prefix . 'thst_audio_type', 'type' => 'radio_inline', 'options' => array('audio-url' => __('Audio File (URL)', 'thstlang'), 'audio-embed-url' => __('Audio Embed (URL)', 'thstlang'), 'audio-embed-code' => __('Audio Embed (Code)', 'thstlang'), 'audio-playlist' => __('Audio Playlist', 'thstlang')), 'default' => 'audio-url'), array('name' => __('Audio URL', 'thstlang'), 'desc' => __('Upload an audio file or enter a URL that ends with a file extension, such as <strong>*.mp3</strong>.', 'thstlang'), 'id' => $prefix . 'thst_audio_url', 'type' => 'file'), array('name' => __('Audio Embed URL', 'thstlang'), 'desc' => __('Enter your embed URL here. URL\'s posted here should not end on <strong>*.mp3</strong> or other file extensions. Supported websites are: YouTube, Vimeo, Hulu, DailyMotion, Flickr Video and Qik.', 'thstlang'), 'id' => $prefix . 'thst_audio_embed', 'type' => 'oembed'), array('name' => __('Audio Embed Code', 'thstlang'), 'desc' => __('Paste your embed code here.', 'thstlang'), 'id' => $prefix . 'thst_audio_embed_code', 'type' => 'textarea_code'), array('name' => __('Audio Playlist', 'thstlang'), 'desc' => __('Upload audio to be displayed in a playlist. (Only works with uploads.)', 'thstlang'), 'id' => $prefix . 'thst_audio_playlist', 'type' => 'file_list'), array('name' => __('Audio Caption', 'thstlang'), 'desc' => __('Enter a short audio caption.(optional)', 'thstlang'), 'id' => $prefix . 'thst_audio_capt', 'type' => 'text'), array('name' => __('Allow Download', 'thstlang'), 'desc' => __('Check this box if you would like your users to be able to download your audio file. (Might not work with files hosted on Soundcloud.)', 'thstlang'), 'id' => $prefix . 'thst_audio_download', 'type' => 'checkbox'), array('name' => __('Explicit', 'thstlang'), 'desc' => __('Please check this box if you would like your post to be marked as explicit.', 'thstlang'), 'id' => $prefix . 'thst_audio_explicit', 'type' => 'checkbox'))); $meta_boxes[] = array('id' => 'thst_featured_video', 'title' => __('Featured Video', 'thstlang'), 'pages' => array('post'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true, 'fields' => array(array('name' => 'Video Type', 'id' => $prefix . 'thst_video_type', 'type' => 'radio_inline', 'options' => array('video-oembed' => __('Video oEmbed Code', 'thstlang'), 'video-embed-url' => __('Video Embed Code', 'thstlang'), 'video-url' => __('Video URL', 'thstlang'), 'video-playlist' => __('Video Playlist', 'thstlang')), 'default' => 'video-oembed'), array('name' => __('Video oEmbed Code', 'thstlang'), 'desc' => __('Enter your oembed code here. Supported websites are: YouTube, Vimeo, Hulu, DailyMotion, Flickr Video and Qik.', 'thstlang'), 'id' => $prefix . 'thst_video_embed', 'type' => 'oembed'), array('name' => __('Video Embed Code', 'thstlang'), 'desc' => __('Paste your embed code here.', 'thstlang'), 'id' => $prefix . 'thst_video_embed_code', 'type' => 'textarea_code'), array('name' => __('Video URL', 'thstlang'), 'desc' => __('Upload a video file or enter an URL.', 'thstlang'), 'id' => $prefix . 'thst_video_url', 'type' => 'file'), array('name' => __('Video Playlist', 'thstlang'), 'desc' => __('Upload videos to be displayed in a playlist.(Only works with uploads.)', 'thstlang'), 'id' => $prefix . 'thst_video_playlist', 'type' => 'file_list'), array('name' => __('Thumbnail', 'thstlang'), 'desc' => __('Upload a thumnail for your video. You only need to do this if you are hosting it yourself.', 'thstlang'), 'id' => $prefix . 'thst_video_thumb', 'type' => 'file'), array('name' => __('Caption', 'thstlang'), 'desc' => __('Enter a short video caption.(optional)', 'thstlang'), 'id' => $prefix . 'thst_video_capt', 'type' => 'text'), array('name' => __('Allow Download', 'thstlang'), 'desc' => __('Check this box if you would like your users to be able to download your video file. (Only works with self-hosted files.)', 'thstlang'), 'id' => $prefix . 'thst_video_download', 'type' => 'checkbox'), array('name' => __('Explicit', 'thstlang'), 'desc' => __('Please check this box if you would like your post to be marked as explicit.', 'thstlang'), 'id' => $prefix . 'thst_video_explicit', 'type' => 'checkbox'))); } $meta_boxes[] = array('id' => 'thst_featured_gallery', 'title' => __('Featured Gallery', 'thstlang'), 'pages' => array('post'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true, 'fields' => array(array('name' => __('Images', 'thstlang'), 'desc' => __('Upload images that will be displayed in your gallery.', 'thstlang'), 'id' => $prefix . 'thst_gallery_list', 'type' => 'file_list'), array('name' => __('Caption', 'thstlang'), 'desc' => __('Enter a short gallery caption.(optional)', 'thstlang'), 'id' => $prefix . 'thst_gallery_capt', 'type' => 'text'), array('name' => __('Style', 'thstlang'), 'desc' => __('Choose how you would like to display your gallery.', 'thstlang'), 'id' => $prefix . 'thst_post_gallery_style', 'type' => 'radio', 'options' => array(array('name' => __('Slideshow', 'thstlang'), 'value' => 'slideshow'), array('name' => __('Grid', 'thstlang'), 'value' => 'grid'))), array('name' => __('Columns', 'thstlang'), 'desc' => __('Choose the amount of columns (only when set to grid)', 'thstlang'), 'id' => $prefix . 'thst_gallery_col', 'type' => 'select', 'options' => array(array('name' => __('3 Columns', 'thstlang'), 'value' => 'three'), array('name' => __('4 Columns', 'thstlang'), 'value' => 'four'), array('name' => __('5 Columns', 'thstlang'), 'value' => 'five'), array('name' => __('6 Columns', 'thstlang'), 'value' => 'six'), array('name' => __('7 Columns', 'thstlang'), 'value' => 'seven'), array('name' => __('8 Columns', 'thstlang'), 'value' => 'eight'))))); $meta_boxes[] = array('id' => 'thst_page_subtitle', 'title' => __('Page Header Subtitle', 'thstlang'), 'pages' => array('page'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true, 'fields' => array(array('name' => __('Text Alignment', 'thstlang'), 'desc' => __('Align the heading text to the left (default), center or right.', 'thstlang'), 'id' => $prefix . 'thst_page_header_align', 'type' => 'radio', 'options' => array(array('name' => __('Left', 'thstlang'), 'value' => 'text-align:left;'), array('name' => __('Center', 'thstlang'), 'value' => 'text-align:center;'), array('name' => __('Right', 'thstlang'), 'value' => 'text-align:right;'))), array('name' => __('Short Blurb', 'thstlang'), 'desc' => __('Submit a short blub or summery of your page that will appear below the title.', 'thstlang'), 'id' => $prefix . 'thst_page_subtitle', 'type' => 'text'), array('name' => __('Background Style', 'thstlang'), 'desc' => __('Select whether you would like to display your background stretched or tiled.', 'thstlang'), 'id' => $prefix . 'thst_page_header_bg_style', 'type' => 'radio', 'options' => array(array('name' => __('Tiled', 'thstlang'), 'value' => 'background-repeat:repeat, no-repeat;'), array('name' => __('Streched', 'thstlang'), 'value' => 'background-repeat:no-repeat; background-size:cover;'))), array('name' => __('Parallax', 'thstlang'), 'desc' => __('Select if you would like to activate parallax.', 'thstlang'), 'id' => $prefix . 'thst_page_header_parallax', 'type' => 'checkbox', 'std' => ''))); // Add other metaboxes as needed return $meta_boxes; }
</div> <?php } ?> </div><!-- .gallery.grid --> <?php } ?> </div> <?php } } ?> <?php if (get_pod_plugin_active() == 'bpp' && $format == 'audio') { ?> <?php if ($pp_audiourl != '') { ?> <div class="caption-container"> <div class="container"> <div class="row"> <div class="col-lg-12"> <div> <div class="featured audio"> <?php echo __('Podcast:', 'thstlang'); ?> <a onclick="return powerpress_pinw('<?php echo $post->ID;
<?php /** * This file displays your post footer. * @package Podcaster * @since 1.0 * @author Theme Station : http://www.themestation.net * @copyright Copyright (c) 2014, Theme Station * @link http://www.themestation.net * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * */ $options = get_option('podcaster-theme'); $pod_comm_display = isset($options['pod-comments-display']) ? $options['pod-comments-display'] : ''; $podhide_posts = isset($options['pod-archive-hide-in-blog']) ? $options['pod-archive-hide-in-blog'] : ''; $arch_category = isset($options['pod-recordings-category']) ? $options['pod-recordings-category'] : ''; $pod_plugin_active = get_pod_plugin_active(); if (isset($arch_category)) { $ex_cats = array($arch_category); } $pod_avtr_single = isset($options['pod-avatar-single']) ? $options['pod-avatar-single'] : ''; $pod_athnm_single = isset($options['pod-authname-single']) ? $options['pod-authname-single'] : ''; $pod_avtr_blg = isset($options['pod-avatar-blog']) ? $options['pod-avatar-blog'] : ''; $pod_athnm_blg = isset($options['pod-authname-blog']) ? $options['pod-authname-blog'] : ''; $position = get_the_author_meta('user_position'); ?> <?php if (!(is_archive() || is_search())) { ?> <?php wp_link_pages(array('before' => '<div class="post_pagination clearfix">', 'after' => '</div>', 'next_or_number' => 'next_and_number', 'nextpagelink' => __('Next', 'thstlang'), 'previouspagelink' => __('Previous', 'thstlang'), 'pagelink' => '%', 'echo' => 1)); ?>
</div><!-- .row --> </div><!-- .container --> <?php if ($pod_frontpage_header_url != '' || $pod_page_image == true && $thumb_back != '') { ?> </div><!-- .translucent --> <?php } ?> </div><!-- .latest-episode --> <div class="list-of-episodes"> <div class="container"> <div class="row"> <?php /* Varialbes & Paths */ $active_plugin = get_pod_plugin_active(); /* WP_Query() for the most recent posts on the front page */ if ($active_plugin == 'ssp') { $args = array('post_type' => 'podcast', 'posts_per_page' => $pod_front_num_posts, 'offset' => 1, 'paged' => get_query_var('paged'), 'ignore_sticky_posts' => true); $category_posts2 = new WP_Query($args); if ($category_posts2->have_posts()) { while ($category_posts2->have_posts()) { $category_posts2->the_post(); global $ss_podcasting, $wp_query; $id = get_the_ID(); $terms = wp_get_post_terms($id, 'series'); foreach ($terms as $term) { $series_id = $term->term_id; $series = $term->name; break; }
function pod_featured_header_slideshow() { /* Theme Option Values */ $options = get_option('podcaster-theme'); $pod_nav_trans = pod_theme_option('pod-nav-bg'); $pod_fh_type = pod_theme_option('pod-featured-header-type'); $pod_fh_content = pod_theme_option('pod-featured-header-content'); $pod_fh_heading = pod_theme_option('pod-featured-heading'); $pod_frontpage_bg_color = pod_theme_option('pod-fh-bg'); if ($pod_fh_content == 'featured') { $is_featured = array(array('key' => 'cmb_thst_feature_post', 'value' => 'on')); } else { $is_featured = ''; } $pod_fh_slides_amount = isset($options['pod-featured-header-slides-amount']) ? $options['pod-featured-header-slides-amount'] : ''; $arch_category = isset($options['pod-recordings-category']) ? $options['pod-recordings-category'] : ''; $pod_next_week = isset($options['pod-frontpage-nextweek']) ? $options['pod-frontpage-nextweek'] : ''; $pod_sub_buttons = pod_theme_option('pod-subscribe-buttons'); $pod_excerpt_type = isset($options['pod-excerpts-type']) ? $options['pod-excerpts-type'] : ''; if ($pod_next_week == 'hide') { $pod_nextweek_state = 'nw-hidden'; } else { $pod_nextweek_state = ''; } $pod_frontpage_header_par = isset($options['pod-frontpage-header-par']) ? $options['pod-frontpage-header-par'] : ''; if ($pod_frontpage_header_par == TRUE) { $parallax = 'data-stellar-background-ratio="0.5"'; } else { $parallax = ''; } $plugin_inuse = get_pod_plugin_active(); if ($plugin_inuse == 'ssp') { $args = array('posts_per_page' => $pod_fh_slides_amount, 'cat' => '', 'post_type' => 'podcast', 'meta_query' => $is_featured); } else { $args = array('posts_per_page' => $pod_fh_slides_amount, 'cat' => $arch_category, 'post_type' => 'post', 'meta_query' => $is_featured); } $the_query = new WP_Query($args); $output = ''; if ($the_query->have_posts()) { $output .= '<div class="flexslider-container">'; $output .= '<div id="loading_bg" class="hide_bg"></div>'; $output .= '<div class="front-page-header slideshow loading_featured flexslider ' . pod_is_nav_transparent() . ' ' . pod_is_nav_sticky() . ' ' . $pod_nextweek_state . '">'; $output .= '<div class="slides">'; while ($the_query->have_posts()) { $the_query->the_post(); global $post; /* Post Values */ $post_format = get_post_format($post->ID); $post_title = get_the_title($post->ID); $is_featured = get_post_meta($post->ID, 'cmb_thst_feature_post', true); $featured_img = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'single-post-thumbnail'); $header_img = get_post_meta($post->ID, 'cmb_thst_feature_post_img', true); $bg_style = get_post_meta($post->ID, 'cmb_thst_page_header_bgstyle', true); $post_permalink = get_permalink($post->ID); $has_excerpt = get_post_meta($post->ID, 'cmb_thst_feature_post_excerpt', true); $excerpt_count = get_post_meta($post->ID, 'cmb_thst_featured_post_excerpt_count', true); $post_align = get_post_meta($post->ID, 'cmb_thst_feature_post_align', true); $post_object = get_post($post->ID); if ($has_excerpt == 'on') { if ($post_object->post_excerpt) { $post_excerpt = $post_object->post_excerpt; } elseif (isset($excerpt_count)) { $post_excerpt = pod_flexible_excerpt($post->ID, $excerpt_count); } else { $post_excerpt = ''; } } else { $post_excerpt = ''; } if ($header_img != '') { $header_img_url = $header_img; } else { $header_img_url = $featured_img[0]; } if (!empty($header_img_url)) { $header_state = 'has-header'; } else { $header_state = ''; } $output .= '<div class="background-image slide ' . $header_state . '" style="background-color:' . $pod_frontpage_bg_color . '; background-image: url(' . $header_img_url . '); ' . $bg_style . '"> <div class="inside"> <div class="container"> <div class="row"> <div class="col-lg-12"> <div class="text ' . $post_format . '" style="' . $post_align . '">'; $output .= pod_featured_multimedia($post->ID); $output .= '</div><!-- .text -->'; $output .= '</div> </div> </div> </div><!-- .inside --> </div>'; } $output .= '</div><!-- .slides -->'; $output .= '</div>'; if (function_exists('pod_next_week') && ($pod_next_week == 'show' || $pod_sub_buttons)) { $output .= pod_next_week(); } $output .= '</div>'; } else { $output .= '<div class="empty-slideshow container">'; $output .= '<div class="row">'; $output .= '<div class="col-lg-12">'; $output .= '<div class="placeholder inside">'; $output .= '<p>' . __('Please mark your post(s) as featured for them to appear here.', 'thstlang') . '</p>'; $output .= '</div>'; if (function_exists('pod_next_week') && ($pod_next_week == 'show' || $pod_sub_buttons)) { $output .= pod_next_week(); } $output .= '</div>'; $output .= '</div>'; $output .= '</div>'; } wp_reset_postdata(); return $output; }