Esempio n. 1
0
        /**
         *  Widget front end display
         */
        function widget($args, $instance)
        {
            // Turn $args array into variables.
            extract($args);
            // $instance Defaults
            $instance_defaults = $this->defaults;
            // If we have information in this widget, then ignore the defaults
            if (!empty($instance)) {
                $instance_defaults = array();
            }
            // Parse $instance
            $widget = wp_parse_args($instance, $instance_defaults);
            // Enqueue Masonry if need be
            if ('list-masonry' == $this->check_and_return($widget, 'design', 'liststyle')) {
                $this->enqueue_masonry();
            }
            // Set the span class for each column
            if ('list-list' == $widget['design']['liststyle']) {
                $col_count = 1;
                $span_class = 'span-12';
            } else {
                if (isset($widget['design']['columns'])) {
                    $col_count = str_ireplace('columns-', '', $widget['design']['columns']);
                    $span_class = 'span-' . 12 / $col_count;
                } else {
                    $col_count = 3;
                    $span_class = 'span-4';
                }
            }
            // Apply Styling
            layers_inline_styles('#' . $widget_id, 'background', array('background' => $widget['design']['background']));
            layers_inline_styles('#' . $widget_id, 'color', array('selectors' => array('.section-title h3.heading', '.section-title div.excerpt'), 'color' => $widget['design']['fonts']['color']));
            layers_inline_styles('#' . $widget_id, 'background', array('selectors' => array('.thumbnail:not(.with-overlay) .thumbnail-body'), 'background' => array('color' => $this->check_and_return($widget, 'design', 'column-background-color'))));
            layers_inline_button_styles('#' . $widget_id, 'button', array('selectors' => array('.thumbnail-body a.button'), 'button' => $this->check_and_return($widget, 'design', 'buttons')));
            // Apply the advanced widget styling
            $this->apply_widget_advanced_styling($widget_id, $widget);
            // Set Image Sizes
            if (isset($widget['design']['imageratios'])) {
                // Translate Image Ratio
                $image_ratio = layers_translate_image_ratios($widget['design']['imageratios']);
                if ('layout-boxed' == $this->check_and_return($widget, 'design', 'layout') && $col_count > 2) {
                    $use_image_ratio = $image_ratio . '-medium';
                } elseif ('layout-boxed' != $this->check_and_return($widget, 'design', 'layout') && $col_count > 3) {
                    $use_image_ratio = $image_ratio . '-large';
                } else {
                    $use_image_ratio = $image_ratio . '-large';
                }
            } else {
                $use_image_ratio = 'large';
            }
            // Begin query arguments
            $query_args = array();
            if (get_query_var('paged')) {
                $query_args['paged'] = get_query_var('paged');
            } else {
                if (get_query_var('page')) {
                    $query_args['paged'] = get_query_var('page');
                } else {
                    $query_args['paged'] = 1;
                }
            }
            $query_args['post_type'] = $this->post_type;
            $query_args['posts_per_page'] = $widget['posts_per_page'];
            if (isset($widget['order'])) {
                $decode_order = json_decode($widget['order'], true);
                if (is_array($decode_order)) {
                    foreach ($decode_order as $key => $value) {
                        $query_args[$key] = $value;
                    }
                }
            }
            // Do the special taxonomy array()
            if (isset($widget['category']) && '' != $widget['category'] && 0 != $widget['category']) {
                $query_args['tax_query'] = array(array("taxonomy" => $this->taxonomy, "field" => "id", "terms" => $widget['category']));
            } elseif (!isset($widget['hide_category_filter'])) {
                $terms = get_terms($this->taxonomy);
            }
            // if we haven't selected which category to show, let's load the $terms for use in the filter
            // Do the WP_Query
            $post_query = new WP_Query($query_args);
            // Set the meta to display
            global $layers_post_meta_to_display;
            $layers_post_meta_to_display = array();
            if (isset($widget['show_dates'])) {
                $layers_post_meta_to_display[] = 'date';
            }
            if (isset($widget['show_author'])) {
                $layers_post_meta_to_display[] = 'author';
            }
            if (isset($widget['show_categories'])) {
                $layers_post_meta_to_display[] = 'categories';
            }
            if (isset($widget['show_tags'])) {
                $layers_post_meta_to_display[] = 'tags';
            }
            /**
             * Generate the widget container class
             */
            $widget_container_class = array();
            $widget_container_class[] = 'widget';
            $widget_container_class[] = 'row';
            $widget_container_class[] = 'content-vertical-massive';
            $widget_container_class[] = $this->check_and_return($widget, 'design', 'advanced', 'customclass');
            $widget_container_class[] = $this->get_widget_spacing_class($widget);
            $widget_container_class = implode(' ', apply_filters('layers_post_widget_container_class', $widget_container_class));
            ?>

			<section class=" <?php 
            echo $widget_container_class;
            ?>
" id="<?php 
            echo $widget_id;
            ?>
">
				<?php 
            if ('' != $this->check_and_return($widget, 'title') || '' != $this->check_and_return($widget, 'excerpt')) {
                ?>
					<div class="container clearfix">
						<?php 
                /**
                 * Generate the Section Title Classes
                 */
                $section_title_class = array();
                $section_title_class[] = 'section-title clearfix';
                $section_title_class[] = $this->check_and_return($widget, 'design', 'fonts', 'size');
                $section_title_class[] = $this->check_and_return($widget, 'design', 'fonts', 'align');
                $section_title_class[] = $this->check_and_return($widget, 'design', 'background', 'color') && 'dark' == layers_is_light_or_dark($this->check_and_return($widget, 'design', 'background', 'color')) ? 'invert' : '';
                $section_title_class = implode(' ', $section_title_class);
                ?>
						<div class="<?php 
                echo $section_title_class;
                ?>
">
							<?php 
                if ('' != $widget['title']) {
                    ?>
								<h3 class="heading"><?php 
                    echo $widget['title'];
                    ?>
</h3>
							<?php 
                }
                ?>
							<?php 
                if ('' != $widget['excerpt']) {
                    ?>
								<div class="excerpt"><?php 
                    echo $widget['excerpt'];
                    ?>
</div>
							<?php 
                }
                ?>
						</div>
					</div>
				<?php 
            }
            ?>
				<div class="row <?php 
            echo $this->get_widget_layout_class($widget);
            ?>
 <?php 
            echo $this->check_and_return($widget, 'design', 'liststyle');
            ?>
">
					<?php 
            if ($post_query->have_posts()) {
                ?>
						<?php 
                while ($post_query->have_posts()) {
                    $post_query->the_post();
                    if ('list-list' == $widget['design']['liststyle']) {
                        ?>
								<article id="post-<?php 
                        the_ID();
                        ?>
" class="row push-bottom-large">
									<?php 
                        if (isset($widget['show_titles'])) {
                            ?>
										<header class="section-title large">
											<h1 class="heading"><a href="<?php 
                            the_permalink();
                            ?>
"><?php 
                            the_title();
                            ?>
</a></h1>
										</header>
									<?php 
                        }
                        ?>

									<?php 
                        // Layers Featured Media
                        if (isset($widget['show_media'])) {
                            echo layers_post_featured_media(array('postid' => get_the_ID(), 'wrap_class' => 'thumbnail push-bottom span-5 column' . (isset($column['design']['imageratios']) && 'image-round' == $column['design']['imageratios'] ? ' image-rounded' : ''), 'size' => $use_image_ratio));
                        }
                        // if Show Media
                        ?>

									<?php 
                        if (isset($widget['show_excerpts']) || $widget['show_call_to_action'] || !empty($layers_post_meta_to_display)) {
                            ?>
										<div class="column span-7">
											<?php 
                            if (isset($widget['show_excerpts'])) {
                                if (isset($widget['excerpt_length']) && '' == $widget['excerpt_length']) {
                                    echo '<div class="copy push-bottom">';
                                    the_content();
                                    echo '</div>';
                                } else {
                                    if (isset($widget['excerpt_length']) && 0 != $widget['excerpt_length'] && strlen(get_the_excerpt()) > $widget['excerpt_length']) {
                                        echo '<div class="copy push-bottom">' . substr(get_the_excerpt(), 0, $widget['excerpt_length']) . '&#8230;</div>';
                                    } else {
                                        if ('' != get_the_excerpt()) {
                                            echo '<div class="copy push-bottom">' . get_the_excerpt() . '</div>';
                                        }
                                    }
                                }
                            }
                            ?>

											<?php 
                            layers_post_meta(get_the_ID(), $layers_post_meta_to_display, 'footer', 'meta-info push-bottom ' . ('' != $this->check_and_return($widget, 'design', 'column-background-color') && 'dark' == layers_is_light_or_dark($this->check_and_return($widget, 'design', 'column-background-color')) ? 'invert' : ''));
                            ?>

											<?php 
                            if (isset($widget['show_call_to_action']) && $this->check_and_return($widget, 'call_to_action')) {
                                ?>
												<p><a href="<?php 
                                the_permalink();
                                ?>
" class="button"><?php 
                                echo $widget['call_to_action'];
                                ?>
</a></p>
											<?php 
                            }
                            // show call to action
                            ?>
										</div>
									<?php 
                        }
                        ?>
								</article>
							<?php 
                    } else {
                        /**
                         * Set Individual Column CSS
                         */
                        $post_column_class = array();
                        $post_column_class[] = 'layers-masonry-column thumbnail';
                        $post_column_class[] = 'list-masonry' == $this->check_and_return($widget, 'design', 'liststyle') ? 'no-gutter' : '';
                        $post_column_class[] = 'column' . ('on' != $this->check_and_return($widget, 'design', 'gutter') ? '-flush' : '');
                        $post_column_class[] = $span_class;
                        $post_column_class[] = 'overlay' == $this->check_and_return($widget, 'text_style') ? 'with-overlay' : '';
                        $post_column_class[] = '' != $this->check_and_return($widget, 'design', 'column-background-color') && 'dark' == layers_is_light_or_dark($this->check_and_return($widget, 'design', 'column-background-color')) ? 'invert' : '';
                        $post_column_class = implode(' ', $post_column_class);
                        ?>

								<article class="<?php 
                        echo $post_column_class;
                        ?>
" data-cols="<?php 
                        echo $col_count;
                        ?>
">
									<?php 
                        // Layers Featured Media
                        if (isset($widget['show_media'])) {
                            echo layers_post_featured_media(array('postid' => get_the_ID(), 'wrap_class' => 'thumbnail-media' . (isset($column['design']['imageratios']) && 'image-round' == $column['design']['imageratios'] ? ' image-rounded' : ''), 'size' => $use_image_ratio, 'hide_href' => false));
                        }
                        // if Show Media
                        ?>
									<?php 
                        if (isset($widget['show_titles']) || isset($widget['show_excerpts'])) {
                            ?>
										<div class="thumbnail-body">
											<div class="overlay">
												<?php 
                            if (isset($widget['show_titles'])) {
                                ?>
													<header class="article-title">
														<h4 class="heading"><a href="<?php 
                                the_permalink();
                                ?>
"><?php 
                                the_title();
                                ?>
</a></h4>
													</header>
												<?php 
                            }
                            ?>
												<?php 
                            if (isset($widget['show_excerpts'])) {
                                if (isset($widget['excerpt_length']) && '' == $widget['excerpt_length']) {
                                    echo '<div class="excerpt">';
                                    the_content();
                                    echo '</div>';
                                } else {
                                    if (isset($widget['excerpt_length']) && 0 != $widget['excerpt_length'] && strlen(get_the_excerpt()) > $widget['excerpt_length']) {
                                        echo '<div class="excerpt">' . substr(get_the_excerpt(), 0, $widget['excerpt_length']) . '&#8230;</div>';
                                    } else {
                                        if ('' != get_the_excerpt()) {
                                            echo '<div class="excerpt">' . get_the_excerpt() . '</div>';
                                        }
                                    }
                                }
                            }
                            ?>
												<?php 
                            if ('overlay' != $this->check_and_return($widget, 'text_style')) {
                                ?>
													<?php 
                                layers_post_meta(get_the_ID(), $layers_post_meta_to_display, 'footer', 'meta-info ' . ('' != $this->check_and_return($widget, 'design', 'column-background-color') && 'dark' == layers_is_light_or_dark($this->check_and_return($widget, 'design', 'column-background-color')) ? 'invert' : ''));
                                ?>
												<?php 
                            }
                            // Don't show meta if we have chosen overlay
                            ?>
												<?php 
                            if (isset($widget['show_call_to_action']) && $this->check_and_return($widget, 'call_to_action')) {
                                ?>
													<a href="<?php 
                                the_permalink();
                                ?>
" class="button"><?php 
                                echo $widget['call_to_action'];
                                ?>
</a>
												<?php 
                            }
                            // show call to action
                            ?>
											</div>
										</div>
									<?php 
                        }
                        // if show titles || show excerpt
                        ?>
								</article>
							<?php 
                    }
                    // if list-list == liststyle
                    ?>
						<?php 
                }
                // while have_posts
                ?>
					<?php 
            }
            // if have_posts
            ?>
				</div>
				<?php 
            if (isset($widget['show_pagination'])) {
                ?>
					<div class="row products container list-grid">
						<?php 
                layers_pagination(array('query' => $post_query), 'div', 'pagination row span-12 text-center');
                ?>
					</div>
				<?php 
            }
            ?>
			</section>

			<?php 
            if ('list-masonry' == $this->check_and_return($widget, 'design', 'liststyle')) {
                ?>
				<script>
					jQuery(function($){
						layers_masonry_settings[ '<?php 
                echo $widget_id;
                ?>
' ] = [{
								itemSelector: '.layers-masonry-column',
								gutter: <?php 
                echo isset($widget['design']['gutter']) ? 20 : 0;
                ?>
							}];

						$('#<?php 
                echo $widget_id;
                ?>
').find('.list-masonry').layers_masonry( layers_masonry_settings[ '<?php 
                echo $widget_id;
                ?>
' ][0] );
					});
				</script>
			<?php 
            }
            // masonry trigger
            ?>

			<?php 
            // Reset WP_Query
            wp_reset_postdata();
            ?>
		<?php 
        }
Esempio n. 2
0
    ?>
>
				<?php 
    while ($wp_query->have_posts()) {
        $wp_query->the_post();
        global $post;
        ?>
					<?php 
        get_template_part('partials/content', 'list');
        ?>
				<?php 
    }
    // while has_post();
    ?>
				<?php 
    layers_pagination(array('query' => $wp_query));
    ?>
			</div>
		<?php 
}
// if has_post()
?>

		<?php 
get_sidebar('right');
?>
	</div>
</div>
<?php 
do_action('layers_after_blog_template');
get_footer();
                <ul class="products row">
                    <?php 
    while (have_posts()) {
        the_post();
        ?>
                            <?php 
        woocommerce_get_template_part('content', 'product');
        ?>
                    <?php 
    }
    ?>
                </ul>

                <?php 
    layers_pagination();
    ?>

                <?php 
    woocommerce_product_loop_end();
    ?>

            </section>
        <?php 
}
?>

        <?php 
/**
 * Maybe show the right sidebar
 */
Esempio n. 4
0
        /**
         *  Widget front end display
         */
        function widget($args, $instance)
        {
            global $wp_customize;
            $this->backup_inline_css();
            // Turn $args array into variables.
            extract($args);
            // Use defaults if $instance is empty.
            if (empty($instance) && !empty($this->defaults)) {
                $instance = wp_parse_args($instance, $this->defaults);
            }
            // Mix in new/unset defaults on every instance load (NEW)
            $instance = $this->apply_defaults($instance);
            // Enqueue Masonry if need be
            if ('list-masonry' == $this->check_and_return($instance, 'design', 'liststyle')) {
                wp_enqueue_script(LAYERS_THEME_SLUG . '-layers-masonry-js');
            }
            // Set the span class for each column
            if ('list-list' == $instance['design']['liststyle']) {
                $col_count = 1;
                $span_class = 'span-12';
            } else {
                if (isset($instance['design']['columns'])) {
                    $col_count = str_ireplace('columns-', '', $instance['design']['columns']);
                    $span_class = 'span-' . 12 / $col_count;
                } else {
                    $col_count = 3;
                    $span_class = 'span-4';
                }
            }
            // Apply Styling
            $this->inline_css .= layers_inline_styles('#' . $widget_id, 'background', array('background' => $instance['design']['background']));
            $this->inline_css .= layers_inline_styles('#' . $widget_id, 'color', array('selectors' => array('.section-title .heading', '.section-title div.excerpt'), 'color' => $instance['design']['fonts']['color']));
            $this->inline_css .= layers_inline_styles('#' . $widget_id, 'background', array('selectors' => array('.thumbnail-body'), 'background' => array('color' => $this->check_and_return($instance, 'design', 'column-background-color'))));
            // Apply Button Styling.
            $button_size = '';
            if (function_exists('layers_pro_apply_widget_button_styling')) {
                // Apply Layers Pro Button Styling.
                $this->inline_css .= layers_pro_apply_widget_button_styling($this, $instance, array("#{$widget_id} .thumbnail-body a.button"));
                $button_size = $this->check_and_return($instance, 'design', 'buttons-size') ? 'btn-' . $this->check_and_return($instance, 'design', 'buttons-size') : '';
            } else {
                // Apply Button Styling.
                $this->inline_css .= layers_inline_button_styles("#{$widget_id}", 'button', array('selectors' => array('.thumbnail-body a.button'), 'button' => $this->check_and_return($instance, 'design', 'buttons')));
            }
            // Set Image Sizes
            if (isset($instance['design']['imageratios'])) {
                // Translate Image Ratio
                $image_ratio = layers_translate_image_ratios($instance['design']['imageratios']);
                if ('layout-boxed' == $this->check_and_return($instance, 'design', 'layout') && $col_count > 2) {
                    $use_image_ratio = $image_ratio . '-medium';
                } elseif ('layout-boxed' != $this->check_and_return($instance, 'design', 'layout') && $col_count > 3) {
                    $use_image_ratio = $image_ratio . '-large';
                } else {
                    $use_image_ratio = $image_ratio . '-large';
                }
            } else {
                $use_image_ratio = 'large';
            }
            // Begin query arguments
            $query_args = array();
            if (get_query_var('paged')) {
                $query_args['paged'] = get_query_var('paged');
            } else {
                if (get_query_var('page')) {
                    $query_args['paged'] = get_query_var('page');
                } else {
                    $query_args['paged'] = 1;
                }
            }
            $query_args['post_type'] = $this->post_type;
            $query_args['posts_per_page'] = $instance['posts_per_page'];
            if (isset($instance['order'])) {
                $decode_order = json_decode($instance['order'], true);
                if (is_array($decode_order)) {
                    foreach ($decode_order as $key => $value) {
                        $query_args[$key] = $value;
                    }
                }
            }
            // Do the special taxonomy array()
            if (isset($instance['category']) && '' != $instance['category'] && 0 != $instance['category']) {
                $query_args['tax_query'] = array(array("taxonomy" => $this->taxonomy, "field" => "id", "terms" => $instance['category']));
            } elseif (!isset($instance['hide_category_filter'])) {
                $terms = get_terms($this->taxonomy);
            }
            // if we haven't selected which category to show, let's load the $terms for use in the filter
            // Do the WP_Query
            $post_query = new WP_Query($query_args);
            // Set the meta to display
            global $layers_post_meta_to_display;
            $layers_post_meta_to_display = array();
            if (isset($instance['show_dates'])) {
                $layers_post_meta_to_display[] = 'date';
            }
            if (isset($instance['show_author'])) {
                $layers_post_meta_to_display[] = 'author';
            }
            if (isset($instance['show_categories'])) {
                $layers_post_meta_to_display[] = 'categories';
            }
            if (isset($instance['show_tags'])) {
                $layers_post_meta_to_display[] = 'tags';
            }
            // Apply the advanced widget styling
            $this->apply_widget_advanced_styling($widget_id, $instance);
            /**
             * Generate the widget container class
             */
            $widget_container_class = array();
            $widget_container_class[] = 'widget';
            $widget_container_class[] = 'layers-post-widget';
            $widget_container_class[] = 'content-vertical-massive';
            $widget_container_class[] = 'clearfix';
            $widget_container_class[] = 'on' == $this->check_and_return($instance, 'design', 'background', 'darken') ? 'darken' : '';
            $widget_container_class[] = $this->check_and_return($instance, 'design', 'advanced', 'customclass');
            // Apply custom class from design-bar's advanced control.
            $widget_container_class[] = $this->get_widget_spacing_class($instance);
            $widget_container_class = apply_filters('layers_post_widget_container_class', $widget_container_class, $this, $instance);
            $widget_container_class = implode(' ', $widget_container_class);
            // Custom Anchor
            echo $this->custom_anchor($instance);
            ?>

			<div id="<?php 
            echo esc_attr($widget_id);
            ?>
" class="<?php 
            echo esc_attr($widget_container_class);
            ?>
" <?php 
            $this->selective_refresh_atts($args);
            ?>
>

				<?php 
            do_action('layers_before_post_widget_inner', $this, $instance);
            ?>

				<?php 
            if ('' != $this->check_and_return($instance, 'title') || '' != $this->check_and_return($instance, 'excerpt')) {
                ?>
					<div class="container clearfix">
						<?php 
                /**
                 * Generate the Section Title Classes
                 */
                $section_title_class = array();
                $section_title_class[] = 'section-title clearfix';
                $section_title_class[] = $this->check_and_return($instance, 'design', 'fonts', 'size');
                $section_title_class[] = $this->check_and_return($instance, 'design', 'fonts', 'align');
                $section_title_class[] = $this->check_and_return($instance, 'design', 'background', 'color') && 'dark' == layers_is_light_or_dark($this->check_and_return($instance, 'design', 'background', 'color')) ? 'invert' : '';
                $section_title_class = implode(' ', $section_title_class);
                ?>
						<div class="<?php 
                echo $section_title_class;
                ?>
">
							<?php 
                if ('' != $this->check_and_return($instance, 'title')) {
                    ?>
								<<?php 
                    echo $this->check_and_return($instance, 'design', 'fonts', 'heading-type');
                    ?>
 class="heading">
									<?php 
                    echo $instance['title'];
                    ?>
								</<?php 
                    echo $this->check_and_return($instance, 'design', 'fonts', 'heading-type');
                    ?>
>
							<?php 
                }
                ?>
							<?php 
                if ('' != $this->check_and_return($instance, 'excerpt')) {
                    ?>
								<div class="excerpt"><?php 
                    echo layers_the_content($instance['excerpt']);
                    ?>
</div>
							<?php 
                }
                ?>
						</div>
					</div>
				<?php 
            }
            ?>
				<?php 
            if ($post_query->have_posts()) {
                ?>
					<div class="<?php 
                echo $this->get_widget_layout_class($instance);
                ?>
 <?php 
                echo $this->check_and_return($instance, 'design', 'liststyle');
                ?>
">
						<div class="grid">
								<?php 
                while ($post_query->have_posts()) {
                    $post_query->the_post();
                    if ('list-list' == $instance['design']['liststyle']) {
                        ?>
										<article id="post-<?php 
                        the_ID();
                        ?>
" class="clearfix push-bottom-large">
											<?php 
                        if (isset($instance['show_titles'])) {
                            ?>
												<header class="section-title large">
													<h1 class="heading"><a href="<?php 
                            the_permalink();
                            ?>
"><?php 
                            the_title();
                            ?>
</a></h1>
												</header>
											<?php 
                        }
                        ?>

											<?php 
                        // Layers Featured Media );
                        if (isset($instance['show_media'])) {
                            echo layers_post_featured_media(array('postid' => get_the_ID(), 'wrap_class' => 'thumbnail push-bottom span-5 column' . ('image-round' == $this->check_and_return($instance, 'design', 'imageratios') ? ' image-rounded' : ''), 'size' => $use_image_ratio));
                        }
                        // if Show Media
                        ?>

											<?php 
                        if (isset($instance['show_excerpts']) || $instance['show_call_to_action'] || !empty($layers_post_meta_to_display)) {
                            ?>
												<div class="column span-7">
													<?php 
                            if (isset($instance['show_excerpts'])) {
                                if (isset($instance['excerpt_length']) && '' == $instance['excerpt_length']) {
                                    echo '<div class="copy push-bottom">';
                                    the_content();
                                    echo '</div>';
                                } else {
                                    if (isset($instance['excerpt_length']) && 0 != $instance['excerpt_length'] && strlen(get_the_excerpt()) > $instance['excerpt_length']) {
                                        echo '<div class="copy push-bottom">' . substr(get_the_excerpt(), 0, $instance['excerpt_length']) . '&#8230;</div>';
                                    } else {
                                        if ('' != get_the_excerpt()) {
                                            echo '<div class="copy push-bottom">' . get_the_excerpt() . '</div>';
                                        }
                                    }
                                }
                            }
                            ?>

													<?php 
                            layers_post_meta(get_the_ID(), $layers_post_meta_to_display, 'footer', 'meta-info push-bottom ' . ('' != $this->check_and_return($instance, 'design', 'column-background-color') && 'dark' == layers_is_light_or_dark($this->check_and_return($instance, 'design', 'column-background-color')) ? 'invert' : ''));
                            ?>

													<?php 
                            if (isset($instance['show_call_to_action']) && $this->check_and_return($instance, 'call_to_action')) {
                                ?>
														<p><a href="<?php 
                                the_permalink();
                                ?>
" class="button <?php 
                                echo $button_size;
                                ?>
"><?php 
                                echo $instance['call_to_action'];
                                ?>
</a></p>
													<?php 
                            }
                            // show call to action
                            ?>
												</div>
											<?php 
                        }
                        ?>
										</article>
									<?php 
                    } else {
                        /**
                         * Set Individual Column CSS
                         */
                        $post_column_class = array();
                        $post_column_class[] = 'layers-masonry-column';
                        $post_column_class[] = 'thumbnail';
                        $post_column_class[] = 'list-masonry' == $this->check_and_return($instance, 'design', 'liststyle') ? 'no-gutter' : '';
                        $post_column_class[] = 'column' . ('on' != $this->check_and_return($instance, 'design', 'gutter') ? '-flush' : '');
                        $post_column_class[] = $span_class;
                        $post_column_class[] = 'overlay' == $this->check_and_return($instance, 'text_style') ? 'with-overlay' : '';
                        $post_column_class[] = '' != $this->check_and_return($instance, 'design', 'column-background-color') && 'dark' == layers_is_light_or_dark($this->check_and_return($instance, 'design', 'column-background-color')) ? 'invert' : '';
                        $post_column_class = implode(' ', $post_column_class);
                        ?>

										<article class="<?php 
                        echo $post_column_class;
                        ?>
" data-cols="<?php 
                        echo $col_count;
                        ?>
">
											<?php 
                        // Layers Featured Media
                        if (isset($instance['show_media'])) {
                            echo layers_post_featured_media(array('postid' => get_the_ID(), 'wrap_class' => 'thumbnail-media' . ('image-round' == $this->check_and_return($instance, 'design', 'imageratios') ? ' image-rounded' : ''), 'size' => $use_image_ratio, 'hide_href' => false));
                        }
                        // if Show Media
                        ?>
											<?php 
                        if (isset($instance['show_titles']) || isset($instance['show_excerpts'])) {
                            ?>
												<div class="thumbnail-body">
													<div class="overlay">
														<?php 
                            if (isset($instance['show_titles'])) {
                                ?>
															<header class="article-title">
																<h4 class="heading"><a href="<?php 
                                the_permalink();
                                ?>
"><?php 
                                the_title();
                                ?>
</a></h4>
															</header>
														<?php 
                            }
                            ?>
														<?php 
                            if (isset($instance['show_excerpts'])) {
                                if (isset($instance['excerpt_length']) && '' == $instance['excerpt_length']) {
                                    echo '<div class="excerpt">';
                                    the_content();
                                    echo '</div>';
                                } else {
                                    if (isset($instance['excerpt_length']) && 0 != $instance['excerpt_length'] && strlen(get_the_excerpt()) > $instance['excerpt_length']) {
                                        echo '<div class="excerpt">' . substr(get_the_excerpt(), 0, $instance['excerpt_length']) . '&#8230;</div>';
                                    } else {
                                        if ('' != get_the_excerpt()) {
                                            echo '<div class="excerpt">' . get_the_excerpt() . '</div>';
                                        }
                                    }
                                }
                            }
                            ?>
														<?php 
                            if ('overlay' != $this->check_and_return($instance, 'text_style')) {
                                ?>
															<?php 
                                layers_post_meta(get_the_ID(), $layers_post_meta_to_display, 'footer', 'meta-info ' . ('' != $this->check_and_return($instance, 'design', 'column-background-color') && 'dark' == layers_is_light_or_dark($this->check_and_return($instance, 'design', 'column-background-color')) ? 'invert' : ''));
                                ?>
														<?php 
                            }
                            // Don't show meta if we have chosen overlay
                            ?>
														<?php 
                            if (isset($instance['show_call_to_action']) && $this->check_and_return($instance, 'call_to_action')) {
                                ?>
															<a href="<?php 
                                the_permalink();
                                ?>
" class="button <?php 
                                echo $button_size;
                                ?>
"><?php 
                                echo $instance['call_to_action'];
                                ?>
</a>
														<?php 
                            }
                            // show call to action
                            ?>
													</div>
												</div>
											<?php 
                        }
                        // if show titles || show excerpt
                        ?>
										</article>
									<?php 
                    }
                    // if list-list == liststyle
                    ?>
								<?php 
                }
                // while have_posts
                ?>
						</div><!-- /row -->
					</div>
				<?php 
            }
            // if have_posts
            ?>
				<?php 
            if (isset($instance['show_pagination'])) {
                ?>
					<div class="container">
						<?php 
                layers_pagination(array('query' => $post_query), 'div', 'pagination clearfix');
                ?>
					</div>
				<?php 
            }
            ?>

				<?php 
            do_action('layers_after_post_widget_inner', $this, $instance);
            // Print the Inline Styles for this Widget
            $this->print_inline_css();
            if ('list-masonry' == $this->check_and_return($instance, 'design', 'liststyle')) {
                ?>
					<script type='text/javascript'>
						jQuery(function($){
							$('#<?php 
                echo $widget_id;
                ?>
').find('.list-masonry .grid').layers_masonry({
								itemSelector: '.layers-masonry-column',
								gutter: <?php 
                echo isset($instance['design']['gutter']) ? 20 : 0;
                ?>
,
							});
						});
					</script>
				<?php 
            }
            // masonry trigger
            ?>

			</div>

			<?php 
            // Reset WP_Query
            wp_reset_postdata();
        }