Exemplo n.º 1
0
function parse_tm_related_post_func($atts, $content)
{
    $title = isset($atts['title']) ? $atts['title'] : '';
    $postformat = isset($atts['postformat']) ? $atts['postformat'] : '';
    $posttypes = isset($atts['posttypes']) ? $atts['posttypes'] : 'post';
    $count = isset($atts['count']) ? $atts['count'] : '';
    $tags = isset($atts['tag']) ? $atts['tag'] : '';
    $orderby = isset($atts['orderby']) ? $atts['orderby'] : '';
    if (function_exists('ot_get_option')) {
        $themes_pur = ot_get_option('theme_purpose');
    }
    if (function_exists('ot_get_option')) {
        $layout_ct_video = ot_get_option('single_layout_ct_video');
        if ($layout_ct_video != 'full') {
            $count = '4';
        } else {
            $count = '6';
        }
    }
    $item_loop_video = new CT_ContentHelper();
    $the_query = $item_loop_video->tm_get_related_posts($posttypes, $tags, $postformat, $count, $orderby, $args = array());
    $thumb = 'thumb_196x126';
    $show_title = 1;
    $show_meta = $show_exceprt = 0;
    $item_video = new CT_ContentHtml();
    if ($the_query->have_posts()) {
        $html = '
		<div class="smart-box smart-box-style-2 is-carousel" >';
        $html .= '<div class="re-box-head">
		<h3 class="related-title">' . $title . '</h3>
		</div>
		<div class="smart-box-content">
			<div class="smart-item">
				<div class="row">
		';
        $show_exceprt = $show_rate = $show_dur = $show_view = $show_com = $show_like = $show_aut = $show_date = '0';
        while ($the_query->have_posts()) {
            $the_query->the_post();
            if ($layout_ct_video != 'full') {
                $html .= '
				<div class="col-md-3 col-sm-6 col-xs-6">';
            } else {
                $html .= '
				<div class="col-md-2 col-sm-6 col-xs-6">';
            }
            $html .= $item_video->get_item_relate_video($thumb, $show_title, $show_exceprt, $show_rate, $show_dur, $show_view, $show_com, $show_like, $show_aut, $show_date, $themes_pur);
            $html .= '</div>';
        }
        $html .= '</div>
			</div>
		</div>
	</div>
	<div class="clear"></div>
	';
    }
    wp_reset_query();
    return $html;
}