Пример #1
0
function Hex2HSB($hex)
{
    return RGB2HSB(Hex2RGB($hex));
}
Пример #2
0
                            echo $recent['post_title'];
                            ?>
</a></h2>
											<?php 
                            echo $reviewsBlock;
                            ?>
										<?php 
                        }
                        ?>
										<div class="post_descr"><p><?php 
                        echo $recent['post_descr'];
                        ?>
</p></div>
										<div class="post_content_padding theme_puzzles"<?php 
                        if ($recent['post_hover_bg'] != '' && $recent['post_hover_bg'] != 'default') {
                            $rgb = Hex2RGB($recent['post_hover_bg']);
                            $post_hover_ie = str_replace('#', '', $recent['post_hover_bg']);
                            echo " style=\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tbackground: -moz-linear-gradient(top,  rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0) 0%, rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0.01) 1%, rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},1) 50%);\n\t\t\t\t\t\t\t\t\t\t\t\t\tbackground: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0)), color-stop(1%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0.01)), color-stop(50%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},1)));\n\t\t\t\t\t\t\t\t\t\t\t\t\tbackground: -webkit-linear-gradient(top,  rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0) 0%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0.01) 1%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},1) 50%);\n\t\t\t\t\t\t\t\t\t\t\t\t\tbackground: -o-linear-gradient(top,  rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0) 0%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0.01) 1%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},1) 50%);\n\t\t\t\t\t\t\t\t\t\t\t\t\tbackground: -ms-linear-gradient(top,  rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0) 0%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0.01) 1%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},1) 50%);\n\t\t\t\t\t\t\t\t\t\t\t\t\tbackground: linear-gradient(to bottom,  rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0) 0%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0.01) 1%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},1) 50%);\n\t\t\t\t\t\t\t\t\t\t\t\t\tfilter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00{$post_hover_ie}', endColorstr='#{$post_hover_ie}',GradientType=0 );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"";
                        }
                        ?>
></div>
									</div>
									<?php 
                    }
                    if (!$recent['post_protected']) {
                        if ($recent['post_audio']) {
                            // If post have audio - show it
                            echo $recent['post_audio'];
                        }
                    }
                    ?>
        echo $post_title;
        ?>
</a></h2>
				<?php 
        echo $reviewsBlock;
        ?>
			<?php 
    }
    ?>
			<div class="post_descr"><?php 
    echo $post_descr;
    ?>
</div>
			<div class="post_content_padding theme_puzzles"<?php 
    if ($post_hover_bg != '' && $post_hover_bg != 'default') {
        $rgb = Hex2RGB($post_hover_bg);
        $post_hover_ie = str_replace('#', '', $post_hover_bg);
        echo " style=\"\n\t\t\t\t\t\tbackground: -moz-linear-gradient(top,  rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0) 0%, rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0.01) 1%, rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},1) 50%);\n\t\t\t\t\t\tbackground: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0)), color-stop(1%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0.01)), color-stop(50%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},1)));\n\t\t\t\t\t\tbackground: -webkit-linear-gradient(top,  rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0) 0%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0.01) 1%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},1) 50%);\n\t\t\t\t\t\tbackground: -o-linear-gradient(top,  rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0) 0%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0.01) 1%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},1) 50%);\n\t\t\t\t\t\tbackground: -ms-linear-gradient(top,  rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0) 0%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0.01) 1%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},1) 50%);\n\t\t\t\t\t\tbackground: linear-gradient(to bottom,  rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0) 0%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0.01) 1%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},1) 50%);\n\t\t\t\t\t\tfilter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00{$post_hover_ie}', endColorstr='#{$post_hover_ie}',GradientType=0 );\n\t\t\t\t\t\t\"";
    }
    ?>
></div>
		</div>
		<?php 
}
if (!$post_protected) {
    if ($post_audio) {
        // If post have audio - show it
        echo $post_audio;
    }
}
?>
Пример #4
0
function sc_slider($atts, $content = null)
{
    if (in_shortcode_blogger()) {
        return '';
    }
    extract(shortcode_atts(array("id" => "", "class" => "", "engine" => get_custom_option('substitute_slider_engine'), "chop_effect" => "", "alias" => "", "ids" => "", "cat" => "", "count" => "0", "offset" => "", "orderby" => "date", "order" => 'desc', "border" => "none", "controls" => "no", "pagination" => "no", "titles" => "no", "descriptions" => get_custom_option('slider_descriptions'), "links" => "no", "align" => "", "interval" => "", "date_format" => "", "crop" => "on", "width" => "", "height" => "", "top" => "", "bottom" => "", "left" => "", "right" => ""), $atts));
    global $THEMEREX_sc_slider_engine, $THEMEREX_sc_slider_width, $THEMEREX_sc_slider_height, $THEMEREX_sc_slider_links;
    if (empty($width)) {
        $width = "100%";
    }
    if (empty($interval)) {
        $interval = mt_rand(5000, 10000);
    }
    if ($engine == 'chop' && !file_exists(themerex_get_file_dir('/js/chopslider/jquery.id.chopslider-2.0.0.free.min.js'))) {
        $engine = 'swiper';
    }
    if ($engine == 'chop' && empty($chop_effect)) {
        $effects2D = array("vertical", "horizontal", "half", "multi");
        $effects3D = array("3DBlocks", "3DFlips");
        $chop_effect = $effects2D[min(3, mt_rand(0, 3))] . '|' . $effects3D[min(1, mt_rand(0, 1))];
    }
    $THEMEREX_sc_slider_engine = $engine;
    $THEMEREX_sc_slider_width = getStyleValue($width);
    $THEMEREX_sc_slider_height = getStyleValue($height);
    $THEMEREX_sc_slider_links = sc_param_is_on($links);
    if (empty($id)) {
        $id = "sc_slider_" . str_replace('.', '', mt_rand());
    }
    $ms = getStyleString($top, $right, $bottom, $left);
    $ws = getStyleString('', '', '', '', $width);
    $hs = getStyleString('', '', '', '', '', $height);
    $s = ($border == 'none' && !in_array($pagination, array('full', 'over')) ? $ms : '') . $hs . $ws;
    if ($border != 'none' && in_array($pagination, array('full', 'over'))) {
        $pagination = 'yes';
    }
    if ($engine != 'flex' && $engine != 'chop' && $engine != 'swiper' && in_array($pagination, array('full', 'over'))) {
        $pagination = 'yes';
    }
    $output = ($border != 'none' ? '<div class="sc_border sc_border_' . $border . ($align != '' && $align != 'none' ? ' sc_align' . $align : '') . '"' . ($ms . $hs ? ' style="' . $ms . $hs . '"' : '') . '>' : '') . (in_array($pagination, array('full', 'over')) ? '<div class="sc_slider_pagination_area sc_slider_pagination_' . $pagination . '"' . ($ms . $hs ? ' style="' . $ms . $hs . '"' : '') . '>' : '') . '<div' . ($id ? ' id="' . $id . '"' : '') . ' class="sc_slider' . (!empty($class) ? ' ' . $class : '') . ' sc_slider_' . $engine . (sc_param_is_on($controls) ? ' sc_slider_controls' : ' sc_slider_nocontrols') . (sc_param_is_on($pagination) ? ' sc_slider_pagination' : ' sc_slider_nopagination') . ($border == 'none' && $align != '' && $align != 'none' ? ' sc_align' . $align : '') . ($engine == 'swiper' ? ' swiper-slider-container' : '') . '"' . ((int) $interval > 0 ? ' data-interval="' . $interval . '"' : '') . ($engine == 'chop' ? ' data-effect="' . $chop_effect . '"' : '') . ($s != '' ? ' style="' . $s . '"' : '') . '>';
    $pagination_items = '';
    if ($engine == 'revo') {
        if (revslider_exists() && !empty($alias)) {
            $output .= do_shortcode('[rev_slider ' . $alias . ']');
        } else {
            $output = '';
        }
    } else {
        if ($engine == 'royal') {
            if (royalslider_exists() && !empty($alias)) {
                $output .= do_shortcode('[[new_royalslider id="' . $alias . '"]');
            } else {
                $output = '';
            }
        } else {
            if ($engine == 'flex' || $engine == 'chop' || $engine == 'swiper') {
                $imageAsBackground = $engine != 'chop';
                $caption = '';
                $output .= '<ul class="slides' . ($engine == 'swiper' ? ' swiper-wrapper' : '') . '">';
                $content = do_shortcode($content);
                if ($content) {
                    $output .= $content;
                } else {
                    global $post;
                    if (!empty($ids)) {
                        $posts = explode(',', $ids);
                        $count = count($posts);
                    }
                    $args = array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $count, 'ignore_sticky_posts' => 1, 'order' => $order == 'asc' ? 'asc' : 'desc');
                    if ($offset > 0 && empty($ids)) {
                        $args['offset'] = $offset;
                    }
                    $args = addSortOrderInQuery($args, $orderby, $order);
                    $args = addFiltersInQuery($args, array('thumbs'));
                    $args = addPostsAndCatsInQuery($args, $ids, $cat);
                    $query = new WP_Query($args);
                    $numSlide = 0;
                    while ($query->have_posts()) {
                        $query->the_post();
                        $numSlide++;
                        $post_id = get_the_ID();
                        $post_title = get_the_title();
                        $post_link = get_permalink();
                        $post_date = get_the_date(!empty($date_format) ? $date_format : 'd.m.y');
                        $post_attachment = wp_get_attachment_url(get_post_thumbnail_id($post_id));
                        if (sc_param_is_on($crop)) {
                            $post_attachment = $imageAsBackground ? getResizedImageURL($post_attachment, !empty($width) && themerex_strpos($width, '%') === false ? $width : null, !empty($height) && themerex_strpos($height, '%') === false ? $height : null) : getResizedImageTag($post_attachment, !empty($width) && themerex_strpos($width, '%') === false ? $width : null, !empty($height) && themerex_strpos($height, '%') === false ? $height : null);
                        } else {
                            if (!$imageAsBackground) {
                                $post_attachment = '<img src="' . $post_attachment . '" alt="">';
                            }
                        }
                        $post_accent_color = '';
                        $post_category = '';
                        $post_category_link = '';
                        if (in_array($pagination, array('full', 'over'))) {
                            // Get all post's tags
                            $post_tags_links = '';
                            if (($post_tags_list = get_the_tags()) != 0) {
                                $tag_number = 0;
                                foreach ($post_tags_list as $tag) {
                                    $tag_number++;
                                    $post_tags_links .= '<span class="slide_tag">' . $tag->name . ($tag_number == count($post_tags_list) ? '' : ',') . '</span> ';
                                }
                            }
                            $pagination_items .= '<li' . (empty($pagination_items) ? ' class="' . ($engine == 'chop' ? 'cs-active-pagination' : 'active') . '"' : '') . '>' . '<div class="slide_pager">' . '<div class="slide_date">' . $post_date . '</div>' . '<div class="slide_info">' . '<h4 class="slide_title">' . $post_title . '</h4>' . '<div class="slide_tags">' . $post_tags_links . '</div>' . '</div>' . '</div>' . '</li>';
                        }
                        $output .= '<li' . ' class="' . $engine . '-slide' . ($engine == 'chop' && $numSlide == 1 ? ' cs-activeSlide' : '') . '"' . ' style="' . ($engine == 'chop' && $numSlide == 1 ? 'display:block;' : '') . ($imageAsBackground ? 'background-image:url(' . $post_attachment . ');' : '') . $ws . $hs . '"' . '>' . (sc_param_is_on($links) ? '<a href="' . $post_link . '" title="' . htmlspecialchars($post_title) . '">' : '') . (!$imageAsBackground ? $post_attachment : '');
                        $caption = $engine == 'swiper' || $engine == 'flex' ? '' : $caption;
                        if (!sc_param_is_off($titles)) {
                            $post_hover_bg = get_custom_option('theme_color', null, $post_id);
                            $post_bg = '';
                            if ($post_hover_bg != '' && !is_inherit_option($post_hover_bg)) {
                                $rgb = Hex2RGB($post_hover_bg);
                                $post_hover_ie = str_replace('#', '', $post_hover_bg);
                                $post_bg = "background-color: rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0.8);";
                            }
                            $caption .= ($engine == 'chop' ? '<div class="sc_slider_info_item">' : '') . '<div class="sc_slider_info' . ($titles == 'fixed' ? ' sc_slider_info_fixed' : '') . ($engine == 'swiper' ? ' content-slide' : '') . '"' . ($post_bg != '' ? ' style="' . $post_bg . '"' : '') . '>';
                            $post_descr = getPostDescription();
                            if (get_custom_option("slider_info_category") == 'yes') {
                                // || empty($cat)) {
                                // Get all post's categories
                                $post_categories = getCategoriesByPostId($post_id);
                                $post_categories_str = '';
                                for ($i = 0; $i < count($post_categories); $i++) {
                                    if ($post_category == '') {
                                        if (get_theme_option('close_category') == 'parental') {
                                            $parent_cat_id = 0;
                                            //(int) get_custom_option('category_id');
                                            $parent_cat = getParentCategory($post_categories[$i]['term_id'], $parent_cat_id);
                                            if ($parent_cat) {
                                                $post_category = $parent_cat['name'];
                                                $post_category_link = $parent_cat['link'];
                                                if ($post_accent_color == '') {
                                                    $post_accent_color = get_category_inherited_property($parent_cat['term_id'], 'theme_color');
                                                }
                                            }
                                        } else {
                                            $post_category = $post_categories[$i]['name'];
                                            $post_category_link = $post_categories[$i]['link'];
                                            if ($post_accent_color == '') {
                                                $post_accent_color = get_category_inherited_property($post_categories[$i]['term_id'], 'theme_color');
                                            }
                                        }
                                    }
                                    if ($post_category != '' && $post_accent_color != '') {
                                        break;
                                    }
                                }
                                if ($post_category == '' && count($post_categories) > 0) {
                                    $post_category = $post_categories[0]['name'];
                                    $post_category_link = $post_categories[0]['link'];
                                    if ($post_accent_color == '') {
                                        $post_accent_color = get_category_inherited_property($post_categories[0]['term_id'], 'theme_color');
                                    }
                                }
                                if ($post_category != '') {
                                    $caption .= '<div class="sc_slider_category"' . (themerex_substr($post_accent_color, 0, 1) == '#' ? ' style="background-color: ' . $post_accent_color . '"' : '') . '><a href="' . $post_category_link . '">' . $post_category . '</a></div>';
                                }
                            }
                            $output_reviews = '';
                            if (get_custom_option('show_reviews') == 'yes' && get_custom_option('slider_reviews') == 'yes') {
                                $avg_author = marksToDisplay(get_post_meta($post_id, 'reviews_avg' . (get_theme_option('reviews_first') == 'author' && $orderby != 'users_rating' || $orderby == 'author_rating' ? '' : '2'), true));
                                if ($avg_author > 0) {
                                    $output_reviews .= '<div class="sc_slider_reviews reviews_summary blog_reviews' . (get_custom_option("slider_info_category") == 'yes' ? ' after_category' : '') . '">' . '<div class="criteria_summary criteria_row">' . getReviewsSummaryStars($avg_author) . '</div>' . '</div>';
                                }
                            }
                            if (get_custom_option("slider_info_category") == 'yes') {
                                $caption .= $output_reviews;
                            }
                            $caption .= '<h2 class="sc_slider_subtitle"><a href="' . $post_link . '">' . $post_title . '</a></h2>';
                            if (get_custom_option("slider_info_category") != 'yes') {
                                $caption .= $output_reviews;
                            }
                            if ($descriptions > 0) {
                                $caption .= '<div class="sc_slider_descr">' . getShortString($post_descr, $descriptions) . '</div>';
                            }
                            $caption .= '</div>' . ($engine == 'chop' ? '</div>' : '');
                        }
                        $output .= ($engine == 'swiper' || $engine == 'flex' ? $caption : '') . (sc_param_is_on($links) ? '</a>' : '') . '</li>';
                    }
                    wp_reset_postdata();
                }
                $output .= '</ul>';
                if ($engine == 'swiper' || $engine == 'chop') {
                    if (sc_param_is_on($controls)) {
                        $output .= '
					<ul class="flex-direction-nav">
					<li><a class="flex-prev" href="#"></a></li>
					<li><a class="flex-next" href="#"></a></li>
					</ul>';
                    }
                    if (sc_param_is_on($pagination)) {
                        $output .= '<div class="flex-control-nav"></div>';
                    }
                }
                if ($engine == 'chop') {
                    $output .= '
				<div class="sc_slider_info_slides">' . $caption . '</div>
				<div class="sc_slider_info_holder"></div>
				';
                }
            } else {
                $output = '';
            }
        }
    }
    if (!empty($output)) {
        $output .= '</div>' . ($border != 'none' ? '</div>' : '');
        if ($pagination_items) {
            $output .= '
				<div class="flex-control-nav manual"' . ($hs ? ' style="' . $hs . '"' : '') . '>
					<div id="' . $id . '_scroll" class="sc_scroll sc_scroll_vertical swiper-slider-container scroll-container"' . ($hs ? ' style="' . $hs . '"' : '') . '>
						<div class="sc_scroll_wrapper swiper-wrapper">
							<div class="sc_scroll_slide swiper-slide">
								<ul>' . $pagination_items . '</ul>
							</div>
						</div>
						<div id="' . $id . '_scroll_bar" class="sc_scroll_bar sc_scroll_bar_vertical"></div>
					</div>
				</div>';
            $output .= '</div>';
        }
    }
    return $output;
}
Пример #5
0
function sc_slider($atts, $content = null)
{
    extract(shortcode_atts(array("id" => "", "engine" => "flex", "links" => "0", "controls" => "0", "titles" => "0", "alias" => "", "ids" => "", "cat" => "", "count" => "0", "offset" => "", "orderby" => "date", "order" => 'desc', "width" => "", "height" => "", "align" => "", "border" => "0", "top" => "", "bottom" => "", "left" => "", "right" => ""), $atts));
    $s = ($top !== '' ? 'margin-top:' . $top . 'px;' : '') . ($bottom !== '' ? 'margin-bottom:' . $bottom . 'px;' : '') . ($left !== '' ? 'margin-left:' . $left . 'px;' : '') . ($right !== '' ? 'margin-right:' . $right . 'px;' : '') . (!empty($width) ? 'width:' . $width . (themerex_strpos($width, '%') !== false ? '' : 'px') . ';' : '') . (!empty($height) ? 'height:' . $height . (themerex_strpos($height, '%') !== false ? '' : 'px') . ';' : '');
    $output = '<div' . ($id ? ' id="' . $id . '"' : '') . ' class="sc_slider' . ' sc_slider_' . $engine . ($controls > 0 ? ' sc_slider_controls' : '') . ($align != '' ? ' align' . $align : '') . ($border > 0 ? ' sc_slider_border' : '') . '"' . ($s != '' ? ' style="' . $s . '"' : '') . '>';
    if ($engine == 'revo') {
        if (is_plugin_active('revslider/revslider.php') && !empty($alias)) {
            $output .= do_shortcode('[rev_slider ' . $alias . ']');
        } else {
            $output = '';
        }
    } else {
        if ($engine == 'flex') {
            $output .= '<ul class="slides">';
            global $post;
            if (!empty($ids)) {
                $posts = explode(',', $ids);
                $count = count($posts);
            }
            $args = array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $count, 'ignore_sticky_posts' => 1, 'order' => $order == 'asc' ? 'asc' : 'desc');
            if ($offset > 0 && empty($ids)) {
                $args['offset'] = $offset;
            }
            $args = addSortOrderInQuery($args, $orderby, $order, true);
            $args = addPostsAndCatsInQuery($args, $ids, $cat);
            $query = new WP_Query($args);
            while ($query->have_posts()) {
                $query->the_post();
                $post_id = get_the_ID();
                $post_link = get_permalink();
                $post_attachment = wp_get_attachment_url(get_post_thumbnail_id($post_id));
                $post_accent_color = '';
                $post_accent_category = '';
                $post_title = getPostTitle($post_id);
                $output .= '<li style="background-image:url(' . $post_attachment . ')">' . ($links > 0 ? '<a href="' . $post_attachment . '" title="' . htmlspecialchars($post_title) . '">' : '');
                if ($titles) {
                    $post_hover_bg = get_custom_option('puzzles_post_bg', null, $post_id);
                    $post_bg = '';
                    if ($post_hover_bg != '' && $post_hover_bg != 'default') {
                        $rgb = Hex2RGB($post_hover_bg);
                        $post_hover_ie = str_replace('#', '', $post_hover_bg);
                        $post_bg = "background-color: rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0.8);";
                    }
                    $output .= '<div class="sc_slider_info' . ($titles > 1 ? ' sc_slider_info_fixed' : '') . ' theme_accent_bg"' . ($post_bg != '' ? ' style="' . $post_bg . '"' : '') . '>';
                    $post_descr = getPostDescription();
                    if (get_custom_option("slider_info_category") == 'yes') {
                        // || empty($cat)) {
                        // Get all post's categories
                        $post_categories = getCategoriesByPostId($post_id);
                        $post_categories_str = '';
                        for ($i = 0; $i < count($post_categories); $i++) {
                            if ($post_accent_category == '') {
                                if (get_theme_option('close_category') == 'parental') {
                                    $parent_cat_id = 0;
                                    //(int) get_custom_option('category_id');
                                    $parent_cat = getParentCategory($post_categories[$i]['term_id'], $parent_cat_id);
                                    if ($parent_cat) {
                                        $post_accent_category = $parent_cat['name'];
                                        if ($post_accent_color == '') {
                                            $post_accent_color = getCategoryInheritedProperty($parent_cat['term_id'], 'theme_accent_color');
                                        }
                                    }
                                } else {
                                    $post_accent_category = $post_categories[$i]['name'];
                                    if ($post_accent_color == '') {
                                        $post_accent_color = getCategoryInheritedProperty($post_categories[$i]['term_id'], 'theme_accent_color');
                                    }
                                }
                            }
                            if ($post_accent_category != '' && $post_accent_color != '') {
                                break;
                            }
                        }
                        if ($post_accent_category == '' && count($post_categories) > 0) {
                            $post_accent_category = $post_categories[0]['name'];
                            if ($post_accent_color == '') {
                                $post_accent_color = getCategoryInheritedProperty($post_categories[0]['term_id'], 'theme_accent_color');
                            }
                        }
                        if ($post_accent_category != '') {
                            $output .= '<div class="sc_slider_category theme_accent_bg"' . (themerex_substr($post_accent_color, 0, 1) == '#' ? ' style="background-color: ' . $post_accent_color . '"' : '') . '>' . $post_accent_category . '</div>';
                        }
                    }
                    $output_reviews = '';
                    if (get_custom_option('show_reviews') == 'yes' && get_custom_option('slider_reviews') == 'yes') {
                        $avg_author = marksToDisplay(get_post_meta($post_id, 'reviews_avg' . (get_theme_option('reviews_first') == 'author' && $orderby != 'users_rating' || $orderby == 'author_rating' ? '' : '2'), true));
                        if ($avg_author > 0) {
                            $output_reviews .= '<div class="sc_slider_reviews reviews_summary blog_reviews' . (get_custom_option("slider_info_category") == 'yes' ? ' after_category' : '') . '">' . '<div class="criteria_summary criteria_row">' . getReviewsSummaryStars($avg_author) . '</div>' . '</div>';
                        }
                    }
                    if (get_custom_option("slider_info_category") == 'yes') {
                        $output .= $output_reviews;
                    }
                    $output .= '<h2 class="sc_slider_subtitle"><a href="' . $post_link . '">' . $post_title . '</a></h2>';
                    if (get_custom_option("slider_info_category") != 'yes') {
                        $output .= $output_reviews;
                    }
                    if (get_custom_option('slider_descriptions') == 'yes') {
                        $output .= '<div class="sc_slider_descr">' . $post_descr . '</div>';
                    }
                    $output .= '</div>';
                } else {
                    //$output .= '<a href="'. $post_link . '">'.$titles.'</a>';
                }
                $output .= ($links > 0 ? '</a>' : '') . '</li>';
            }
            wp_reset_postdata();
            $output .= '</ul>';
        } else {
            $output = '';
        }
    }
    $output .= !empty($output) ? '</div>' : '';
    return $output;
}