Пример #1
0
$excerpt_length = isset($atts['excerpt_length']) && $atts['excerpt_length'] != '' ? $atts['excerpt_length'] : $exc_lnth;
$ts_show = ts_maybe_show_blog_elements($atts);
$show_excerpt = $excerpt_length == '0' || !$ts_show->excerpt ? false : true;
$title_size = ts_get_blog_loop_title_size($atts, 4);
$text_align = ts_get_blog_loop_text_align($atts);
$allow_vids = isset($atts['allow_videos']) ? $atts['allow_videos'] : '';
$allow_gals = isset($atts['allow_galleries']) ? $atts['allow_galleries'] : '';
if ($ts_query->have_posts()) {
    while ($ts_query->have_posts()) {
        $ts_query->the_post();
        $atts['exclude_these_later'] = isset($atts['exclude_these_later']) ? $atts['exclude_these_later'] : '';
        if (!ts_attr_is_false($atts['exclude_these_later'])) {
            $ts_previous_posts[] = $ts_query->post->ID;
        }
        $post_type = get_post_type();
        $category = ts_get_the_category(ts_get_the_display_taxonomy($atts), 'big_array:1', '', $ts_query->post->ID);
        $media = ts_get_featured_media(array('media_width' => 480, 'media_height' => 0, 'gallery_width' => 480, 'gallery_height' => 320, 'allow_videos' => $allow_vids, 'allow_galleries' => $allow_gals));
        ?>

                        <div id="post-<?php 
        echo esc_attr($ts_query->post->ID);
        ?>
" class="hentry entry masonry-entry <?php 
        echo esc_attr($entry_class);
        ?>
">
                            <div class="post-content">
                                <div class="post-category post-category-heading mimic-small uppercase <?php 
        echo ts_loop_post_category_class($atts, $media);
        ?>
">
Пример #2
0
$widget_heading_size = ts_figure_h_size($widget_heading_size, 5);
if (isset($atts['override_widget_heading']) && ts_attr_is_true($atts['override_widget_heading'])) {
    if (isset($atts['category_name']) && trim($atts['category_name'])) {
        $cat_name = $atts['category_name'];
        $cat_names = explode(',', $cat_name);
        if (count($cat_names) == 1) {
            $cat = get_category_by_slug($cat_name);
            if ($cat !== false) {
                $widget_heading = '<a href="' . get_category_link($cat->term_id) . '" class="color-primary">' . esc_html($cat->name) . '<i class="fa fa-angle-right"></i></a>';
            }
        }
    } elseif (isset($atts['cat']) && trim($atts['cat'])) {
        $cat = $atts['cat'];
        $cats = explode(',', $cat);
        if (count($cats) == 1) {
            $cat = get_term_by('id', $cat, ts_get_the_display_taxonomy($atts));
            if ($cat !== false) {
                $widget_heading = '<a href="' . ts_get_term_link($cat) . '" class="color-primary">' . esc_html($cat->name) . '<i class="fa fa-angle-right"></i></a>';
            }
        }
    }
}
$text_align = ts_get_blog_loop_text_align($atts);
?>

                <div class="loop-widget-wrap loop-widget-simple-wrap <?php 
echo esc_attr(ts_loop_wrap_class($atts));
?>
">
                    <?php 
if (trim($widget_heading)) {