function shortcode_callback($atts, $content = null, $function_name)
    {
        /**
         * Cached $wp_filter so it can be restored at the end of the callback.
         * This is needed because this callback uses the_content filter / calls a function
         * which uses the_content filter. WordPress doesn't support nested filter
         */
        global $wp_filter;
        $wp_filter_cache = $wp_filter;
        $module_id = $this->shortcode_atts['module_id'];
        $module_class = $this->shortcode_atts['module_class'];
        $show_arrows = $this->shortcode_atts['show_arrows'];
        $show_pagination = $this->shortcode_atts['show_pagination'];
        $parallax = $this->shortcode_atts['parallax'];
        $parallax_method = $this->shortcode_atts['parallax_method'];
        $auto = $this->shortcode_atts['auto'];
        $auto_speed = $this->shortcode_atts['auto_speed'];
        $auto_ignore_hover = $this->shortcode_atts['auto_ignore_hover'];
        $top_padding = $this->shortcode_atts['top_padding'];
        $body_font_size = $this->shortcode_atts['body_font_size'];
        $bottom_padding = $this->shortcode_atts['bottom_padding'];
        $remove_inner_shadow = $this->shortcode_atts['remove_inner_shadow'];
        $hide_content_on_mobile = $this->shortcode_atts['hide_content_on_mobile'];
        $hide_cta_on_mobile = $this->shortcode_atts['hide_cta_on_mobile'];
        $show_image_video_mobile = $this->shortcode_atts['show_image_video_mobile'];
        $background_position = $this->shortcode_atts['background_position'];
        $background_size = $this->shortcode_atts['background_size'];
        $posts_number = $this->shortcode_atts['posts_number'];
        $include_categories = $this->shortcode_atts['include_categories'];
        $show_more_button = $this->shortcode_atts['show_more_button'];
        $more_text = $this->shortcode_atts['more_text'];
        $content_source = $this->shortcode_atts['content_source'];
        $background_color = $this->shortcode_atts['background_color'];
        $show_image = $this->shortcode_atts['show_image'];
        $image_placement = $this->shortcode_atts['image_placement'];
        $background_image = $this->shortcode_atts['background_image'];
        $background_layout = $this->shortcode_atts['background_layout'];
        $use_bg_overlay = $this->shortcode_atts['use_bg_overlay'];
        $bg_overlay_color = $this->shortcode_atts['bg_overlay_color'];
        $use_text_overlay = $this->shortcode_atts['use_text_overlay'];
        $text_overlay_color = $this->shortcode_atts['text_overlay_color'];
        $orderby = $this->shortcode_atts['orderby'];
        $show_meta = $this->shortcode_atts['show_meta'];
        $button_custom = $this->shortcode_atts['custom_button'];
        $custom_icon = $this->shortcode_atts['button_icon'];
        $use_manual_excerpt = $this->shortcode_atts['use_manual_excerpt'];
        $excerpt_length = $this->shortcode_atts['excerpt_length'];
        $text_border_radius = $this->shortcode_atts['text_border_radius'];
        $dot_nav_custom_color = $this->shortcode_atts['dot_nav_custom_color'];
        $arrows_custom_color = $this->shortcode_atts['arrows_custom_color'];
        $top_padding_tablet = $this->shortcode_atts['top_padding_tablet'];
        $top_padding_phone = $this->shortcode_atts['top_padding_phone'];
        $bottom_padding_tablet = $this->shortcode_atts['bottom_padding_tablet'];
        $bottom_padding_phone = $this->shortcode_atts['bottom_padding_phone'];
        $module_class = ET_Builder_Element::add_module_order_class($module_class, $function_name);
        $hide_on_mobile_class = self::HIDE_ON_MOBILE;
        if ('' !== $top_padding || '' !== $top_padding_tablet || '' !== $top_padding_phone) {
            $padding_values = array('desktop' => $top_padding, 'tablet' => $top_padding_tablet, 'phone' => $top_padding_phone);
            et_pb_generate_responsive_css($padding_values, '%%order_class%% .et_pb_slide_description', 'padding-top', $function_name);
        }
        if ('' !== $bottom_padding || '' !== $bottom_padding_tablet || '' !== $bottom_padding_phone) {
            $padding_values = array('desktop' => $bottom_padding, 'tablet' => $bottom_padding_tablet, 'phone' => $bottom_padding_phone);
            et_pb_generate_responsive_css($padding_values, '%%order_class%% .et_pb_slide_description', 'padding-bottom', $function_name);
        }
        if ('' !== $bottom_padding || '' !== $top_padding) {
            ET_Builder_Module::set_style($function_name, array('selector' => '%%order_class%% .et_pb_slide_description', 'declaration' => 'padding-right: 0; padding-left: 0;'));
        }
        if ('default' !== $background_position && 'off' === $parallax) {
            $processed_position = str_replace('_', ' ', $background_position);
            ET_Builder_Module::set_style($function_name, array('selector' => '%%order_class%% .et_pb_slide', 'declaration' => sprintf('background-position: %1$s;', esc_html($processed_position))));
        }
        if ('default' !== $background_size && 'off' === $parallax) {
            ET_Builder_Module::set_style($function_name, array('selector' => '%%order_class%% .et_pb_slide', 'declaration' => sprintf('-moz-background-size: %1$s;
					-webkit-background-size: %1$s;
					background-size: %1$s;', esc_html($background_size))));
            if ('initial' === $background_size) {
                ET_Builder_Module::set_style($function_name, array('selector' => 'body.ie %%order_class%% .et_pb_slide', 'declaration' => sprintf('-moz-background-size: %1$s;
						-webkit-background-size: %1$s;
						background-size: %1$s;', 'auto')));
            }
        }
        if ('' !== $background_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_post_slider', 'declaration' => sprintf('background-color: %1$s;', esc_html($background_color))));
        }
        if ('' !== $background_image) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%, %%order_class%%.et_pb_bg_layout_dark, %%order_class%%.et_pb_bg_layout_light', 'declaration' => sprintf('background-image: url(%1$s);', esc_url($background_image))));
        }
        if ('on' === $use_bg_overlay && '' !== $bg_overlay_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%% .et_pb_slide .et_pb_slide_overlay_container', 'declaration' => sprintf('background-color: %1$s;', esc_html($bg_overlay_color))));
        }
        if ('on' === $use_text_overlay && '' !== $text_overlay_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%% .et_pb_slide .et_pb_slide_title, %%order_class%% .et_pb_slide .et_pb_slide_content', 'declaration' => sprintf('background-color: %1$s;', esc_html($text_overlay_color))));
        }
        if ('' !== $text_border_radius) {
            $border_radius_value = et_builder_process_range_value($text_border_radius);
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_slider_with_text_overlay h2.et_pb_slide_title', 'declaration' => sprintf('-webkit-border-top-left-radius: %1$s;
					-webkit-border-top-right-radius: %1$s;
					-moz-border-radius-topleft: %1$s;
					-moz-border-radius-topright: %1$s;
					border-top-left-radius: %1$s;
					border-top-right-radius: %1$s;', esc_html($border_radius_value))));
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_slider_with_text_overlay .et_pb_slide_content', 'declaration' => sprintf('-webkit-border-bottom-right-radius: %1$s;
					-webkit-border-bottom-left-radius: %1$s;
					-moz-border-radius-bottomright: %1$s;
					-moz-border-radius-bottomleft: %1$s;
					border-bottom-right-radius: %1$s;
					border-bottom-left-radius: %1$s;', esc_html($border_radius_value))));
        }
        $fullwidth = 'et_pb_fullwidth_post_slider' === $function_name ? 'on' : 'off';
        $class = '';
        $class .= 'off' === $fullwidth ? ' et_pb_slider_fullwidth_off' : '';
        $class .= 'off' === $show_arrows ? ' et_pb_slider_no_arrows' : '';
        $class .= 'off' === $show_pagination ? ' et_pb_slider_no_pagination' : '';
        $class .= 'on' === $parallax ? ' et_pb_slider_parallax' : '';
        $class .= 'on' === $auto ? ' et_slider_auto et_slider_speed_' . esc_attr($auto_speed) : '';
        $class .= 'on' === $auto_ignore_hover ? ' et_slider_auto_ignore_hover' : '';
        $class .= 'on' === $remove_inner_shadow ? ' et_pb_slider_no_shadow' : '';
        $class .= 'on' === $show_image_video_mobile ? ' et_pb_slider_show_image' : '';
        $class .= ' et_pb_post_slider_image_' . $image_placement;
        $class .= 'on' === $use_bg_overlay ? ' et_pb_slider_with_overlay' : '';
        $class .= 'on' === $use_text_overlay ? ' et_pb_slider_with_text_overlay' : '';
        $data_dot_nav_custom_color = '' !== $dot_nav_custom_color ? sprintf(' data-dots_color="%1$s"', esc_attr($dot_nav_custom_color)) : '';
        $data_arrows_custom_color = '' !== $arrows_custom_color ? sprintf(' data-arrows_color="%1$s"', esc_attr($arrows_custom_color)) : '';
        $args = array('posts_per_page' => (int) $posts_number);
        if ('' !== $include_categories) {
            $args['cat'] = $include_categories;
        }
        if ('date_desc' !== $orderby) {
            switch ($orderby) {
                case 'date_asc':
                    $args['orderby'] = 'date';
                    $args['order'] = 'ASC';
                    break;
                case 'title_asc':
                    $args['orderby'] = 'title';
                    $args['order'] = 'ASC';
                    break;
                case 'title_desc':
                    $args['orderby'] = 'title';
                    $args['order'] = 'DESC';
                    break;
                case 'rand':
                    $args['orderby'] = 'rand';
                    break;
            }
        }
        ob_start();
        query_posts($args);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                $slide_class = 'off' !== $show_image && in_array($image_placement, array('left', 'right')) && has_post_thumbnail() ? ' et_pb_slide_with_image' : '';
                $slide_class .= " et_pb_bg_layout_{$background_layout}";
                ?>
			<div class="et_pb_slide et_pb_media_alignment_center<?php 
                echo esc_attr($slide_class);
                ?>
" <?php 
                if ('on' !== $parallax && 'off' !== $show_image && 'background' === $image_placement) {
                    printf('style="background-image:url(%1$s)"', esc_url(wp_get_attachment_url(get_post_thumbnail_id())));
                }
                echo $data_dot_nav_custom_color;
                echo $data_arrows_custom_color;
                ?>
>
				<?php 
                if ('on' === $parallax && 'off' !== $show_image && 'background' === $image_placement) {
                    ?>
					<div class="et_parallax_bg<?php 
                    if ('off' === $parallax_method) {
                        echo ' et_pb_parallax_css';
                    }
                    ?>
" style="background-image: url(<?php 
                    echo esc_url(wp_get_attachment_url(get_post_thumbnail_id()));
                    ?>
);"></div>
				<?php 
                }
                ?>
				<?php 
                if ('on' === $use_bg_overlay) {
                    ?>
					<div class="et_pb_slide_overlay_container"></div>
				<?php 
                }
                ?>
				<div class="et_pb_container clearfix">
					<?php 
                if ('off' !== $show_image && has_post_thumbnail() && !in_array($image_placement, array('background', 'bottom'))) {
                    ?>
						<div class="et_pb_slide_image">
							<?php 
                    the_post_thumbnail();
                    ?>
						</div>
					<?php 
                }
                ?>
					<div class="et_pb_slide_description">
						<h2 class="et_pb_slide_title"><a href="<?php 
                esc_url(the_permalink());
                ?>
"><?php 
                the_title();
                ?>
</a></h2>
						<div class="et_pb_slide_content <?php 
                if ('on' === $hide_content_on_mobile) {
                    echo esc_attr($hide_on_mobile_class);
                }
                ?>
">
							<?php 
                if ('off' !== $show_meta) {
                    printf('<p class="post-meta">%1$s | %2$s | %3$s | %4$s</p>', et_get_safe_localization(sprintf(__('by %s', 'et_builder'), '<span class="author vcard">' . et_pb_get_the_author_posts_link() . '</span>')), et_get_safe_localization(sprintf(__('%s', 'et_builder'), '<span class="published">' . esc_html(get_the_date()) . '</span>')), get_the_category_list(', '), sprintf(esc_html(_nx('1 Comment', '%s Comments', get_comments_number(), 'number of comments', 'et_builder')), number_format_i18n(get_comments_number())));
                }
                ?>
							<?php 
                $post_content = get_the_content();
                // do not display the content if it contains Blog, Post Slider, Fullwidth Post Slider, or Portfolio modules to avoid infinite loops
                if (!has_shortcode($post_content, 'et_pb_blog') && !has_shortcode($post_content, 'et_pb_portfolio') && !has_shortcode($post_content, 'et_pb_post_slider') && !has_shortcode($post_content, 'et_pb_fullwidth_post_slider')) {
                    if ('on' === $content_source) {
                        global $more;
                        $post_content = et_strip_shortcodes($post_content);
                        // page builder doesn't support more tag, so display the_content() in case of post made with page builder
                        if (et_pb_is_pagebuilder_used(get_the_ID())) {
                            $more = 1;
                            echo apply_filters('the_content', $post_content);
                        } else {
                            $more = null;
                            echo apply_filters('the_content', et_strip_shortcodes(get_the_content(esc_html__('read more...', 'et_builder'))));
                        }
                    } else {
                        if (has_excerpt() && 'off' !== $use_manual_excerpt) {
                            the_excerpt();
                        } else {
                            truncate_post(intval($excerpt_length), true, '', true);
                        }
                    }
                } else {
                    if (has_excerpt()) {
                        the_excerpt();
                    }
                }
                ?>
						</div>
						<?php 
                if ('off' !== $show_more_button && '' !== $more_text) {
                    printf('<a href="%1$s" class="et_pb_more_button et_pb_button%4$s%5$s"%3$s>%2$s</a>', esc_url(get_permalink()), esc_html($more_text), '' !== $custom_icon && 'on' === $button_custom ? sprintf(' data-icon="%1$s"', esc_attr(et_pb_process_font_icon($custom_icon))) : '', '' !== $custom_icon && 'on' === $button_custom ? ' et_pb_custom_button_icon' : '', 'on' === $hide_cta_on_mobile ? esc_attr(" {$hide_on_mobile_class}") : '');
                }
                ?>
					</div> <!-- .et_pb_slide_description -->
					<?php 
                if ('off' !== $show_image && has_post_thumbnail() && 'bottom' === $image_placement) {
                    ?>
						<div class="et_pb_slide_image">
							<?php 
                    the_post_thumbnail();
                    ?>
						</div>
					<?php 
                }
                ?>
				</div> <!-- .et_pb_container -->
			</div> <!-- .et_pb_slide -->
		<?php 
            }
            // end while
            wp_reset_query();
        }
        // end if
        $content = ob_get_contents();
        ob_end_clean();
        $output = sprintf('<div%3$s class="et_pb_module et_pb_slider et_pb_post_slider%1$s%4$s">
				<div class="et_pb_slides">
					%2$s
				</div> <!-- .et_pb_slides -->
			</div> <!-- .et_pb_slider -->
			', $class, $content, '' !== $module_id ? sprintf(' id="%1$s"', esc_attr($module_id)) : '', '' !== $module_class ? sprintf(' %1$s', esc_attr($module_class)) : '');
        // Restore $wp_filter
        $wp_filter = $wp_filter_cache;
        unset($wp_filter_cache);
        return $output;
    }
Exemple #2
0
            ?>
</span></span>
				<?php 
        }
        ?>
			</a>
			
			<h3><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h3>
			<p><?php 
        truncate_post(115);
        ?>
</p>
			
			<a href="<?php 
        the_permalink();
        ?>
" class="more"><span><?php 
        esc_html_e('more info', 'eStore');
        ?>
</span></a>
			
			<?php 
        if ($et_band != '') {
            ?>
				<span class="band<?php 
Exemple #3
0
            the_title();
            ?>
"><img src="<?php 
            bloginfo('stylesheet_directory');
            ?>
/timthumb.php?src=<?php 
            echo $thumb;
            ?>
&amp;h=98&amp;w=98&amp;zc=1" alt="<?php 
            if ($thumb_alt !== '') {
                echo $thumb_alt;
            } else {
                echo the_title();
            }
            ?>
"  style="border: none;" /></a> </div>
    <?php 
        }
        ?>
    <?php 
        truncate_post(420);
        ?>
	 <div style="clear: both;"></div>
</div>
<?php 
    }
    include TEMPLATEPATH . '/includes/page-navigation.php';
} else {
    include TEMPLATEPATH . '/includes/no-results.php';
}
wp_reset_query();
Exemple #4
0
" rel="bookmark" title="Permanent Link to <?php 
        the_title_attribute();
        ?>
"><?php 
        the_title();
        ?>
</a></h2>

				<div class="entry">
                <?php 
        if (function_exists('get_the_image')) {
            get_the_image(array('custom_key' => array('post_thumbnail'), 'default_size' => 'full', 'image_class' => 'alignleft', 'width' => '198', 'height' => '166'));
        }
        ?>
                    <p><?php 
        truncate_post(380, true);
        ?>
</p>
				</div>
                <div class="meta">
                 <span class="time">Posted on <?php 
        the_time('F d, Y');
        ?>
</span><a class="more-link" href="<?php 
        the_permalink();
        ?>
#more">Read More</a>
                </div>

			</div>
Exemple #5
0
function et_show_ajax_project()
{
    global $wp_embed;
    $project_id = (int) $_POST['et_project_id'];
    $portfolio_args = array('post_type' => 'project', 'p' => $project_id);
    $portfolio_query = new WP_Query(apply_filters('et_ajax_portfolio_args', $portfolio_args));
    while ($portfolio_query->have_posts()) {
        $portfolio_query->the_post();
        global $post;
        $width = (int) apply_filters('et_ajax_media_width', 600);
        $height = (int) apply_filters('et_ajax_media_height', 480);
        $titletext = get_the_title();
        $media = get_post_meta(get_the_ID(), '_et_used_images', true);
        echo '<div class="et_media">';
        if ($media) {
            echo '<div class="flexslider"><ul class="slides">';
            foreach ((array) $media as $et_media) {
                echo '<li class="slide">';
                if (is_numeric($et_media)) {
                    $et_fullimage_array = wp_get_attachment_image_src($et_media, 'full');
                    if ($et_fullimage_array) {
                        $et_fullimage = $et_fullimage_array[0];
                        echo '<img src="' . esc_attr(et_new_thumb_resize(et_multisite_thumbnail($et_fullimage), $width, $height, '', true)) . '" width="' . esc_attr($width) . '" height="' . esc_attr($height) . '" alt="' . esc_attr($titletext) . '" />';
                    }
                } else {
                    $video_embed = apply_filters('the_content', $wp_embed->shortcode('', esc_url($et_media)));
                    $video_embed = preg_replace('/<embed /', '<embed wmode="transparent" ', $video_embed);
                    $video_embed = preg_replace('/<\\/object>/', '<param name="wmode" value="transparent" /></object>', $video_embed);
                    $video_embed = preg_replace("/height=\"[0-9]*\"/", "height={$height}", $video_embed);
                    $video_embed = preg_replace("/width=\"[0-9]*\"/", "width={$width}", $video_embed);
                    echo $video_embed;
                }
                echo '</li>';
            }
            echo '</ul></div>';
        } else {
            $thumb = '';
            $classtext = '';
            $titletext = get_the_title();
            $thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Ajaximage');
            $thumb = $thumbnail["thumb"];
            echo '<a href="' . esc_url(get_permalink()) . '">';
            print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext);
            echo '</a>';
        }
        echo '</div> <!-- end .et_media -->';
        echo '<div class="et_media_description">' . '<h2 class="title">' . '<a href="' . get_permalink() . '">' . get_the_title() . '</a>' . '</h2>' . truncate_post(560, false);
        echo '</div> <!-- end .et_media_description -->';
        echo '<a class="more" href="' . get_permalink() . '">' . __('More info &raquo;', 'Flexible') . '</a>';
    }
    wp_reset_postdata();
    die;
}
                ?>
</a>
													<a class="et_portfolio_more_icon" href="<?php 
                the_permalink();
                ?>
"><?php 
                esc_html_e('Read more', 'eStore');
                ?>
</a>
												</div> <!-- end .et_pt_portfolio_image -->
											</div> <!-- end .et_pt_portfolio_entry -->
											<?php 
                if ($et_ptemplate_showdesc) {
                    ?>
												<p><?php 
                    truncate_post(90);
                    ?>
</p>
											<?php 
                }
                ?>
										</div> <!-- end .et_pt_portfolio_item -->
								
								<?php 
                if ($et_ptemplate_portfolio_size == 2 && !$fullwidth && $portfolio_count % 2 == 0 || $et_ptemplate_portfolio_size == 3 && $portfolio_count % 2 == 0) {
                    $et_open_row = false;
                    ?>
									</div> <!-- end .et_pt_portfolio_row -->
								<?php 
                }
                ?>
Exemple #7
0
    the_title();
    ?>
</a></h2>
				<?php 
    if ('' != $slide_subtitle) {
        ?>
					<p class="subtitle"><?php 
        echo esc_html($slide_subtitle);
        ?>
</p>
				<?php 
    }
    ?>

					<p><?php 
    truncate_post(180);
    ?>
</p>

					<a href="<?php 
    echo esc_url($more_link);
    ?>
" class="more">
						<?php 
    if ('' != $slide_more_text) {
        echo esc_html($slide_more_text);
    } else {
        esc_html_e('Read More', 'Fusion');
    }
    ?>
					</a>
Exemple #8
0
    function shortcode_callback($atts, $content = null, $function_name)
    {
        $module_id = $this->shortcode_atts['module_id'];
        $module_class = $this->shortcode_atts['module_class'];
        $fullwidth = $this->shortcode_atts['fullwidth'];
        $posts_number = $this->shortcode_atts['posts_number'];
        $include_categories = $this->shortcode_atts['include_categories'];
        $meta_date = $this->shortcode_atts['meta_date'];
        $show_thumbnail = $this->shortcode_atts['show_thumbnail'];
        $show_content = $this->shortcode_atts['show_content'];
        $show_author = $this->shortcode_atts['show_author'];
        $show_date = $this->shortcode_atts['show_date'];
        $show_categories = $this->shortcode_atts['show_categories'];
        $show_comments = $this->shortcode_atts['show_comments'];
        $show_pagination = $this->shortcode_atts['show_pagination'];
        $background_layout = $this->shortcode_atts['background_layout'];
        $show_more = $this->shortcode_atts['show_more'];
        $offset_number = $this->shortcode_atts['offset_number'];
        $masonry_tile_background_color = $this->shortcode_atts['masonry_tile_background_color'];
        $use_dropshadow = $this->shortcode_atts['use_dropshadow'];
        global $paged;
        $module_class = ET_Builder_Element::add_module_order_class($module_class, $function_name);
        $container_is_closed = false;
        if ('' !== $masonry_tile_background_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_blog_grid .et_pb_post', 'declaration' => sprintf('background-color: %1$s;', esc_html($masonry_tile_background_color))));
        }
        if ('on' !== $fullwidth) {
            if ('on' === $use_dropshadow) {
                $module_class .= ' et_pb_blog_grid_dropshadow';
            }
            wp_enqueue_script('salvattore');
            $background_layout = 'light';
        }
        $args = array('posts_per_page' => (int) $posts_number);
        $et_paged = is_front_page() ? get_query_var('page') : get_query_var('paged');
        if (is_front_page()) {
            $paged = $et_paged;
        }
        if ('' !== $include_categories) {
            $args['cat'] = $include_categories;
        }
        if (!is_search()) {
            $args['paged'] = $et_paged;
        }
        if ('' !== $offset_number && !empty($offset_number)) {
            /**
             * Offset + pagination don't play well. Manual offset calculation required
             * @see: https://codex.wordpress.org/Making_Custom_Queries_using_Offset_and_Pagination
             */
            if ($paged > 1) {
                $args['offset'] = ($et_paged - 1) * intval($posts_number) + intval($offset_number);
            } else {
                $args['offset'] = intval($offset_number);
            }
        }
        if (is_single() && !isset($args['post__not_in'])) {
            $args['post__not_in'] = array(get_the_ID());
        }
        ob_start();
        query_posts($args);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                $post_format = et_pb_post_format();
                $thumb = '';
                $width = 'on' === $fullwidth ? 1080 : 400;
                $width = (int) apply_filters('et_pb_blog_image_width', $width);
                $height = 'on' === $fullwidth ? 675 : 250;
                $height = (int) apply_filters('et_pb_blog_image_height', $height);
                $classtext = 'on' === $fullwidth ? 'et_pb_post_main_image' : '';
                $titletext = get_the_title();
                $thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Blogimage');
                $thumb = $thumbnail["thumb"];
                $no_thumb_class = '' === $thumb || 'off' === $show_thumbnail ? ' et_pb_no_thumb' : '';
                if (in_array($post_format, array('video', 'gallery'))) {
                    $no_thumb_class = '';
                }
                ?>

			<article id="post-<?php 
                the_ID();
                ?>
" <?php 
                post_class('et_pb_post' . $no_thumb_class);
                ?>
>

			<?php 
                et_divi_post_format_content();
                if (!in_array($post_format, array('link', 'audio', 'quote'))) {
                    if ('video' === $post_format && false !== ($first_video = et_get_first_video())) {
                        printf('<div class="et_main_video_container">
								%1$s
							</div>', $first_video);
                    } elseif ('gallery' === $post_format) {
                        et_gallery_images();
                    } elseif ('' !== $thumb && 'on' === $show_thumbnail) {
                        if ('on' !== $fullwidth) {
                            echo '<div class="et_pb_image_container">';
                        }
                        ?>
							<a href="<?php 
                        the_permalink();
                        ?>
">
								<?php 
                        print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height);
                        ?>
							</a>
					<?php 
                        if ('on' !== $fullwidth) {
                            echo '</div> <!-- .et_pb_image_container -->';
                        }
                    }
                }
                ?>

			<?php 
                if ('off' === $fullwidth || !in_array($post_format, array('link', 'audio', 'quote'))) {
                    ?>
				<?php 
                    if (!in_array($post_format, array('link', 'audio'))) {
                        ?>
					<h2><a href="<?php 
                        the_permalink();
                        ?>
"><?php 
                        the_title();
                        ?>
</a></h2>
				<?php 
                    }
                    ?>

				<?php 
                    if ('on' === $show_author || 'on' === $show_date || 'on' === $show_categories || 'on' === $show_comments) {
                        printf('<p class="post-meta">%1$s %2$s %3$s %4$s %5$s %6$s %7$s</p>', 'on' === $show_author ? sprintf(__('by %s', 'et_builder'), et_pb_get_the_author_posts_link()) : '', 'on' === $show_author && 'on' === $show_date ? ' | ' : '', 'on' === $show_date ? sprintf(__('%s', 'et_builder'), get_the_date($meta_date)) : '', ('on' === $show_author || 'on' === $show_date) && 'on' === $show_categories ? ' | ' : '', 'on' === $show_categories ? get_the_category_list(', ') : '', ('on' === $show_author || 'on' === $show_date || 'on' === $show_categories) && 'on' === $show_comments ? ' | ' : '', 'on' === $show_comments ? sprintf(_nx('1 Comment', '%s Comments', get_comments_number(), '', 'et_builder'), number_format_i18n(get_comments_number())) : '');
                    }
                    $post_content = get_the_content();
                    // do not display the content if it contains Blog or Portfolio modules to avoid infinite loops
                    if (!has_shortcode($post_content, 'et_pb_blog') && !has_shortcode($post_content, 'et_pb_portfolio')) {
                        if ('on' === $show_content) {
                            global $more;
                            // page builder doesn't support more tag, so display the_content() in case of post made with page builder
                            if (et_pb_is_pagebuilder_used(get_the_ID())) {
                                $more = 1;
                                the_content();
                            } else {
                                $more = null;
                                the_content(__('read more...', 'et_builder'));
                            }
                        } else {
                            if (has_excerpt()) {
                                the_excerpt();
                            } else {
                                truncate_post(270);
                            }
                        }
                    } else {
                        if (has_excerpt()) {
                            the_excerpt();
                        }
                    }
                    if ('on' !== $show_content) {
                        $more = 'on' == $show_more ? sprintf(' <a href="%1$s" class="more-link" >%2$s</a>', esc_url(get_permalink()), __('read more', 'et_builder')) : '';
                        echo $more;
                    }
                    ?>
			<?php 
                }
                // 'off' === $fullwidth || ! in_array( $post_format, array( 'link', 'audio', 'quote', 'gallery'
                ?>

			</article> <!-- .et_pb_post -->
	<?php 
            }
            // endwhile
            if ('on' === $show_pagination && !is_search()) {
                echo '</div> <!-- .et_pb_posts -->';
                $container_is_closed = true;
                if (function_exists('wp_pagenavi')) {
                    wp_pagenavi();
                } else {
                    get_template_part('includes/navigation', 'index');
                }
            }
            wp_reset_query();
        } else {
            get_template_part('includes/no-results', 'index');
        }
        $posts = ob_get_contents();
        ob_end_clean();
        $class = " et_pb_module et_pb_bg_layout_{$background_layout}";
        $output = sprintf('<div%5$s class="%1$s%3$s%6$s"%7$s>
				%2$s
			%4$s', 'on' === $fullwidth ? 'et_pb_posts' : 'et_pb_blog_grid clearfix', $posts, esc_attr($class), !$container_is_closed ? '</div> <!-- .et_pb_posts -->' : '', '' !== $module_id ? sprintf(' id="%1$s"', esc_attr($module_id)) : '', '' !== $module_class ? sprintf(' %1$s', esc_attr($module_class)) : '', 'on' !== $fullwidth ? ' data-columns' : '');
        if ('on' !== $fullwidth) {
            $output = sprintf('<div class="et_pb_blog_grid_wrapper">%1$s</div>', $output);
        }
        return $output;
    }
Exemple #9
0
</a></h2>
	</div> <!-- .post-description -->
<?php 
}
?>

<?php 
if ($index_postinfo) {
    echo '<p class="meta-info">';
    et_postinfo_meta($index_postinfo, et_get_option('foxy_date_format', 'M j, Y'), esc_html__('0 comments', 'Foxy'), esc_html__('1 comment', 'Foxy'), '% ' . esc_html__('comments', 'Foxy'));
    echo '</p>';
}
if ('false' == et_get_option('foxy_blog_style', 'false')) {
    ?>
	<p><?php 
    truncate_post(370);
    ?>
</p>
<?php 
} else {
    ?>
	<?php 
    the_content('');
}
?>

	<a href="<?php 
the_permalink();
?>
" class="read-more"><?php 
esc_html_e('Read More', 'Foxy');
Exemple #10
0
                ?>
                                        <?php 
                echo '<i class="fa fa-camera"></i>';
                ?>
                                    <?php 
            }
            ?>
                                </div>
                                
                                <div class="content">
                                    <h3 class="itemTitle"><?php 
            the_title();
            ?>
</h3>
                                    <?php 
            truncate_post(220);
            ?>
                                    <a href="<?php 
            the_permalink();
            ?>
"><i class="fa fa-link easeInOut"></i></a>
                                </div>
                            </section>
                <?php 
        }
        ?>
        </section>

    </section>
<?php 
    }
Exemple #11
0
        $et_videos_output = '';
        ?>
						<?php 
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                ?>
							<?php 
                $width = 48;
                $height = 48;
                $titletext = get_the_title();
                $thumbnail = get_thumbnail($width, $height, 'multi-media-image', $titletext, $titletext, true, 'Media');
                $thumb = $thumbnail["thumb"];
                $et_medialink = get_post_meta($post->ID, 'et_medialink', true) ? get_post_meta($post->ID, 'et_medialink', true) : '';
                $et_videolink = get_post_meta($post->ID, 'et_videolink', true) ? get_post_meta($post->ID, 'et_videolink', true) : '';
                $et_media_description = get_post_meta($post->ID, 'et_media_description', true) ? get_post_meta($post->ID, 'et_media_description', true) : truncate_post(90, false);
                ?>
							<?php 
                if ($media_current_post == 1 || ($media_current_post - 1) % 7 == 0) {
                    $media_open = true;
                    ?>
								<div class="media-slide">
							<?php 
                }
                ?>
									<div class="thumb<?php 
                if ($media_current_post % 7 == 0) {
                    echo ' last';
                }
                ?>
">
Exemple #12
0
</a></h2>

						<?php 
    $tagline = get_post_meta(get_the_ID(), 'Tagline', true);
    if ($tagline != '') {
        ?>
							<p class="tagline">&#147;<?php 
        echo wp_kses($tagline, array('span' => array()));
        ?>
&#148;</p>
						<?php 
    }
    ?>

						<p><?php 
    truncate_post(375);
    ?>
</p>
						<a href="<?php 
    the_permalink();
    ?>
" class="readmore"><span><?php 
    esc_html_e('Read More', 'Minimal');
    ?>
</span></a>
					</div> <!-- end .description -->
				</div> <!-- end .slide -->

		<?php 
}
wp_reset_query();
Exemple #13
0
				<?php 
    }
    ?>
	
			</div> 	<!-- end .thumbnail -->	
		<?php 
}
?>
		
		<?php 
if (get_option('delicatenews_blog_style') == 'on') {
    the_content("");
} else {
    ?>
			<p><?php 
    truncate_post(335);
    ?>
</p>
		<?php 
}
?>
		
		<a href="<?php 
the_permalink();
?>
" class="readmore"><span><?php 
_e('read more', 'DelicateNews');
?>
</span></a>
		
	</div> <!-- end .entry .post -->
Exemple #14
0
        $thumb = $thumbnail["thumb"];
        ?>
		
		<?php 
        if ($thumb != '' && get_option('modest_thumbnails_index') == 'on') {
            ?>
			<div class="post-thumbnail">
				<a href="<?php 
            the_permalink();
            ?>
">
					<?php 
            print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext);
            ?>
					<span class="post-overlay"></span>
				</a>	
			</div> 	<!-- end .post-thumbnail -->
		<?php 
        }
        ?>

		<?php 
        if (get_option('modest_blog_style') == 'false') {
            ?>
			<p><?php 
            truncate_post(680);
            ?>
</p>
		<?php 
        } else {
            ?>
Exemple #15
0
"><?php 
    if ($biglayout) {
        truncate_title(50);
    } else {
        truncate_title(20);
    }
    ?>
</a></h2>
		<div class="entry-content">
			<div class="bottom-bg" style="position: relative; top: 30px;">
				<div class="excerpt">
					<p><?php 
    if ($biglayout) {
        truncate_post(650);
    } else {
        truncate_post(295);
    }
    ?>
 </p>
				</div><!-- end .excerpt -->
			</div><!-- end .bottom-bg -->
		</div><!-- end .entry-content -->
	</div><!-- end .entry -->
	
<?php 
} else {
    ?>

	<div class="post">
		<div class="post-content clearfix">			
			<div class="post-text">
Exemple #16
0
 <!-- <?php 
        esc_html_e('on', 'Aggregate');
        ?>
 <?php 
        the_time(esc_attr(get_option('aggregate_date_format')));
        ?>
 --></p>
						<h2 class="featured-title"><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h2>
						<p><?php 
        truncate_post(410);
        ?>
</p>
					</div>
					<a href="<?php 
        the_permalink();
        ?>
" class="readmore"><?php 
        esc_html_e('Read More', 'Aggregate');
        ?>
</a>
				</div> <!-- end .description -->
		<?php 
        if ($responsive) {
            ?>
			</li> <!-- end .slide -->
Exemple #17
0
		<?php 
    }
    ?>
		</div> 	<!-- end .post-thumbnail -->
	<?php 
}
?>

<?php 
if ($is_single) {
    the_content();
    wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'Harmony'), 'after' => '</div>'));
} else {
    if ('on' == et_get_option('harmony_blog_style')) {
        the_content('');
    } else {
        echo '<p>' . truncate_post(400, false) . '</p>';
    }
    ?>

		<a href="<?php 
    the_permalink();
    ?>
" class="more"><?php 
    esc_html_e('Read More', 'Harmony');
    ?>
</a>
<?php 
}
?>
	</article> <!-- end .post-->
Exemple #18
0
    include TEMPLATEPATH . '/includes/featurednav-' . $coldstone_featured_number . '.php';
    ?>
                </div>
                <div class="feat_post">
                    <h2><span><?php 
    echo $loopcounter;
    ?>
. </span><a href="<?php 
    the_permalink();
    ?>
"><?php 
    truncate_title(25);
    ?>
</a></h2>
                    <?php 
    truncate_post(240);
    ?>
                    <div class="keepreading"> <a href="<?php 
    the_permalink();
    ?>
">Continue Reading</a> </div>
                </div>
                <!-- /feat_post -->
            </div>
        </div>
		<?php 
    $ids[] = $post->ID;
    ?>
        <?php 
}
?>
Exemple #19
0
    $featured_query = new WP_Query(apply_filters('et_featured_post_args', array('posts_per_page' => $featured_num, 'cat' => get_catId(et_get_option('nimble_feat_posts_cat')))));
} else {
    global $pages_number;
    if ('' != et_get_option('nimble_feat_pages')) {
        $featured_num = count(et_get_option('nimble_feat_pages'));
    } else {
        $featured_num = $pages_number;
    }
    $featured_query = new WP_Query(apply_filters('et_featured_page_args', array('post_type' => 'page', 'orderby' => 'menu_order', 'order' => 'ASC', 'post__in' => (array) et_get_option('nimble_feat_pages'), 'posts_per_page' => (int) $featured_num)));
}
while ($featured_query->have_posts()) {
    $featured_query->the_post();
    $et_nimble_settings = maybe_unserialize(get_post_meta($post->ID, '_et_nimble_settings', true));
    $link = isset($et_nimble_settings['et_fs_link']) && !empty($et_nimble_settings['et_fs_link']) ? $et_nimble_settings['et_fs_link'] : get_permalink();
    $title = isset($et_nimble_settings['et_fs_title']) && !empty($et_nimble_settings['et_fs_title']) ? $et_nimble_settings['et_fs_title'] : get_the_title();
    $description = isset($et_nimble_settings['et_fs_description']) && !empty($et_nimble_settings['et_fs_description']) ? $et_nimble_settings['et_fs_description'] : truncate_post(40, false);
    ?>
			<li class="slide">					
				<h2><a href="<?php 
    echo esc_url($link);
    ?>
"><?php 
    echo $title;
    ?>
</a></h2>
				<div class="description"><?php 
    echo $description;
    ?>
</div>
				
				<a href="<?php 
Exemple #20
0
					<?php 
            print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext);
            ?>
					<span class="post-overlay"></span>
				</a>
			</div> 	<!-- end .post-thumbnail -->
		<?php 
        }
        ?>
		<?php 
        if (get_option('chameleon_blog_style') == 'on') {
            the_content('');
        } else {
            ?>
			<p><?php 
            truncate_post(600);
            ?>
</p>
		<?php 
        }
        ?>
		<a href="<?php 
        the_permalink();
        ?>
" class="read-more"><?php 
        esc_html_e('Read More', 'Chameleon');
        ?>
</a>
	</div> 	<!-- end .post-->
<?php 
    }
        $featured_num = $pages_number;
    }
    $et_featured_pages_args = array('post_type' => 'page', 'orderby' => 'menu_order', 'order' => 'DESC', 'posts_per_page' => (int) $featured_num);
    if (is_array(et_get_option('mycuisine_feat_pages', '', 'page'))) {
        $et_featured_pages_args['post__in'] = (array) array_map('intval', et_get_option('mycuisine_feat_pages', '', 'page'));
    }
    query_posts($et_featured_pages_args);
}
while (have_posts()) {
    the_post();
    global $post;
    $et_mycuisine_settings = maybe_unserialize(get_post_meta(get_the_ID(), '_et_mycuisine_settings', true));
    $arr[$i]['variation'] = isset($et_mycuisine_settings['et_fs_variation']) ? (int) $et_mycuisine_settings['et_fs_variation'] : 1;
    $arr[$i]["title"] = truncate_title(25, false);
    $arr[$i]["fulltitle"] = truncate_title(250, false);
    $arr[$i]["excerpt"] = isset($et_mycuisine_settings['et_fs_custom_excerpt']) ? $et_mycuisine_settings['et_fs_custom_excerpt'] : truncate_post(180, false);
    $arr[$i]["permalink"] = isset($et_mycuisine_settings['et_fs_link']) && !empty($et_mycuisine_settings['et_fs_link']) ? $et_mycuisine_settings['et_fs_link'] : get_permalink();
    $arr[$i]["thumbnail"] = get_thumbnail($width, $height, '', $arr[$i]["fulltitle"], $arr[$i]["fulltitle"], true, 'Featured');
    $arr[$i]["thumb"] = $arr[$i]["thumbnail"]["thumb"];
    $arr[$i]["use_timthumb"] = $arr[$i]["thumbnail"]["use_timthumb"];
    $arr[$i]["color"] = isset($et_mycuisine_settings['et_fs_bgcolor']) ? $et_mycuisine_settings['et_fs_bgcolor'] : '452917';
    $arr[$i]["color"] = str_replace('#', '', $arr[$i]["color"]);
    $arr[$i]["moretext"] = isset($et_mycuisine_settings['et_fs_button']) && !empty($et_mycuisine_settings['et_fs_button']) ? $et_mycuisine_settings['et_fs_button'] : 'Read More';
    $arr[$i]['post_id'] = (int) get_the_ID();
    $i++;
}
wp_reset_query();
?>

	<?php 
for ($i = 1; $i <= $featured_num; $i++) {
Exemple #22
0
						<!-- Tytuł Kurwa! -->
						<h2 class="entry-title"><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
KURWAAA</a></h2>
					<?php 
            }
            ?>

					<?php 
            et_divi_post_meta();
            if ('on' !== et_get_option('divi_blog_style', 'false') || is_search() && 'on' === get_post_meta(get_the_ID(), '_et_pb_use_builder', true)) {
                truncate_post(1);
            } else {
                the_content();
            }
            ?>
				<?php 
        }
        ?>

					</article> <!-- .et_pb_post -->
			<?php 
    }
    if (function_exists('wp_pagenavi')) {
        wp_pagenavi();
    } else {
        get_template_part('includes/navigation', 'index');
Exemple #23
0
	<div class="entry-thumbnail">
		<a href="<?php 
    the_permalink();
    ?>
">
			<?php 
    print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext);
    ?>
		</a>
	</div> 	<!-- end .entry-thumbnail -->
<?php 
}
if ('false' == et_get_option('fusion_blog_style', 'false')) {
    ?>
	<p><?php 
    truncate_post(480);
    ?>
</p>
<?php 
} else {
    ?>
	<?php 
    the_content('');
}
?>
	<a href="<?php 
the_permalink();
?>
" class="read-more"><?php 
esc_html_e('Read More', 'Fusion');
?>
Exemple #24
0
    function shortcode_callback($atts, $content = null, $function_name)
    {
        $module_id = $this->shortcode_atts['module_id'];
        $module_class = $this->shortcode_atts['module_class'];
        $fullwidth = $this->shortcode_atts['fullwidth'];
        $posts_number = $this->shortcode_atts['posts_number'];
        $include_categories = $this->shortcode_atts['include_categories'];
        $meta_date = $this->shortcode_atts['meta_date'];
        $show_thumbnail = $this->shortcode_atts['show_thumbnail'];
        $show_content = $this->shortcode_atts['show_content'];
        $show_author = $this->shortcode_atts['show_author'];
        $show_date = $this->shortcode_atts['show_date'];
        $show_categories = $this->shortcode_atts['show_categories'];
        $show_comments = $this->shortcode_atts['show_comments'];
        $show_pagination = $this->shortcode_atts['show_pagination'];
        $background_layout = $this->shortcode_atts['background_layout'];
        $show_more = $this->shortcode_atts['show_more'];
        $offset_number = $this->shortcode_atts['offset_number'];
        $masonry_tile_background_color = $this->shortcode_atts['masonry_tile_background_color'];
        $use_dropshadow = $this->shortcode_atts['use_dropshadow'];
        global $paged;
        $module_class = ET_Builder_Element::add_module_order_class($module_class, $function_name);
        $container_is_closed = false;
        // remove all filters from WP audio shortcode to make sure current theme doesn't add any elements into audio module
        remove_all_filters('wp_audio_shortcode_library');
        remove_all_filters('wp_audio_shortcode');
        remove_all_filters('wp_audio_shortcode_class');
        if ('' !== $masonry_tile_background_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_blog_grid .et_pb_post', 'declaration' => sprintf('background-color: %1$s;', esc_html($masonry_tile_background_color))));
        }
        if ('on' !== $fullwidth) {
            if ('on' === $use_dropshadow) {
                $module_class .= ' et_pb_blog_grid_dropshadow';
            }
            wp_enqueue_script('salvattore');
            $background_layout = 'light';
        }
        $args = array('posts_per_page' => (int) $posts_number);
        $et_paged = is_front_page() ? get_query_var('page') : get_query_var('paged');
        if (is_front_page()) {
            $paged = $et_paged;
        }
        if ('' !== $include_categories) {
            $args['cat'] = $include_categories;
        }
        if (!is_search()) {
            $args['paged'] = $et_paged;
        }
        if ('' !== $offset_number && !empty($offset_number)) {
            /**
             * Offset + pagination don't play well. Manual offset calculation required
             * @see: https://codex.wordpress.org/Making_Custom_Queries_using_Offset_and_Pagination
             */
            if ($paged > 1) {
                $args['offset'] = ($et_paged - 1) * intval($posts_number) + intval($offset_number);
            } else {
                $args['offset'] = intval($offset_number);
            }
        }
        if (is_single() && !isset($args['post__not_in'])) {
            $args['post__not_in'] = array(get_the_ID());
        }
        ob_start();
        query_posts($args);
        if (have_posts()) {
            ?>
<script src="https://cdnjs.cloudflare.com/ajax/libs/masonry/3.3.2/masonry.pkgd.js"></script>
			<div class="grid js-masonry"
  data-masonry-options='{ "itemSelector": ".new-post", "columnWidth": ".grid-sizer", "percentPosition": true}'>
  <div class="grid-sizer"></div>
  <?php 
            while (have_posts()) {
                the_post();
                $post_format = et_pb_post_format();
                $thumb = '';
                $width = 'on' === $fullwidth ? 1080 : 400;
                $width = (int) apply_filters('et_pb_blog_image_width', $width);
                $height = 'on' === $fullwidth ? 675 : 250;
                $height = (int) apply_filters('et_pb_blog_image_height', $height);
                $classtext = 'on' === $fullwidth ? 'et_pb_post_main_image' : '';
                $titletext = get_the_title();
                $thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Blogimage');
                $thumb = $thumbnail["thumb"];
                $no_thumb_class = '' === $thumb || 'off' === $show_thumbnail ? ' et_pb_no_thumb' : '';
                if (in_array($post_format, array('video', 'gallery'))) {
                    $no_thumb_class = '';
                }
                ?>

			<article onclick="location.href='<?php 
                the_permalink();
                ?>
';" style="cursor:pointer;" id="post-<?php 
                the_ID();
                ?>
"  class="new-post  <?php 
                $cat_color = get_the_category();
                echo $cat_color[1]->slug;
                echo ' ';
                ?>
"<?php 
                post_class('et_pb_post' . $no_thumb_class);
                ?>
>
			<?php 
                et_divi_post_format_content();
                if (!in_array($post_format, array('link', 'audio', 'quote'))) {
                    if ('video' === $post_format && false !== ($first_video = et_get_first_video())) {
                        printf('<div class="et_main_video_container">
								%1$s
							</div>', $first_video);
                    } elseif ('gallery' === $post_format) {
                        et_pb_gallery_images('slider');
                    } elseif ('' !== $thumb && 'on' === $show_thumbnail) {
                        if ('on' !== $fullwidth) {
                            echo '<div class="et_pb_image_container">';
                        }
                        ?>
							<a href="<?php 
                        the_permalink();
                        ?>
">
								<?php 
                        print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height);
                        ?>
							</a>
					<?php 
                        if ('on' !== $fullwidth) {
                            echo '</div> <!-- .et_pb_image_container -->';
                        }
                    }
                }
                ?>

			<?php 
                if ('off' === $fullwidth || !in_array($post_format, array('link', 'audio', 'quote'))) {
                    ?>
				<?php 
                    if (!in_array($post_format, array('link', 'audio'))) {
                        ?>
					<h2 class="entry-title"><a href="<?php 
                        the_permalink();
                        ?>
"><?php 
                        the_title();
                        ?>
</a></h2>
				<?php 
                    }
                    ?>

				<?php 
                    if ('on' === $show_author || 'on' === $show_date || 'on' === $show_categories || 'on' === $show_comments) {
                        printf('<p class="post-meta"> %2$s %3$s %4$s %5$s %6$s </p>', 'on' === $show_author ? sprintf(__('by %s', 'et_builder'), '<span class="author vcard">' . et_pb_get_the_author_posts_link() . '</span>') : '', 'on' === $show_author && 'on' === $show_date ? '  ' : '  ', 'on' === $show_date ? sprintf(__('%s', 'et_builder'), '<span class="published">' . get_the_date('j F') . '</span>') : '  ', ('on' === $show_author || 'on' === $show_date) && 'on' === $show_categories ? '  ~  ' : '', 'on' === $show_categories ? get_the_category_list(' | ') : '   ', ('on' === $show_author || 'on' === $show_date || 'on' === $show_categories) && 'on' === $show_comments ? '  ' : '  ', 'on' === $show_comments ? sprintf(_nx('1 Comment', '%s Comments', get_comments_number(), 'number of comments', 'et_builder'), number_format_i18n(get_comments_number())) : '  ');
                    }
                    $post_content = get_the_content();
                    // do not display the content if it contains Blog or Portfolio modules to avoid infinite loops
                    if (!has_shortcode($post_content, 'et_pb_blog') && !has_shortcode($post_content, 'et_pb_portfolio')) {
                        if ('on' === $show_content) {
                            global $more;
                            // page builder doesn't support more tag, so display the_content() in case of post made with page builder
                            if (et_pb_is_pagebuilder_used(get_the_ID())) {
                                $more = 1;
                                the_content();
                            } else {
                                $more = null;
                                the_content(__('read more...', 'et_builder'));
                            }
                        } else {
                            if (has_excerpt()) {
                                the_excerpt();
                            } else {
                                truncate_post(70);
                            }
                        }
                    } else {
                        if (has_excerpt()) {
                            the_excerpt();
                        }
                    }
                    // if ( 'on' !== $show_content ) {
                    // 	$more = 'on' == $show_more ? sprintf( ' <a href="%1$s" class="more-link" >%2$s</a>' , esc_url( get_permalink() ), __( 'read more', 'et_builder' ) )  : '';
                    // 	echo $more;
                    // }
                    ?>
			<?php 
                }
                // 'off' === $fullwidth || ! in_array( $post_format, array( 'link', 'audio', 'quote', 'gallery'
                ?>

			</article> <!-- .et_pb_post -->
			
	<?php 
            }
            // endwhile
            ?>
</div>

			  <script>
			  if (screen.width < 1200) {
			  	var thingToRemove = document.querySelectorAll(".et_pb_section_0")[0];
				thingToRemove.parentNode.removeChild(thingToRemove);
				var thingToRemove = document.querySelectorAll(".et_pb_section_2")[0];
				thingToRemove.parentNode.removeChild(thingToRemove);
				}
			  </script>

			<?php 
            if ('on' === $show_pagination && !is_search()) {
                echo '</div> <!-- .et_pb_posts -->';
                $container_is_closed = true;
                if (function_exists('wp_pagenavi')) {
                    wp_pagenavi();
                } else {
                    if (et_is_builder_plugin_active()) {
                        include ET_BUILDER_PLUGIN_DIR . 'includes/navigation.php';
                    } else {
                        get_template_part('includes/navigation', 'index');
                    }
                }
            }
            wp_reset_query();
        } else {
            if (et_is_builder_plugin_active()) {
                include ET_BUILDER_PLUGIN_DIR . 'includes/no-results.php';
            } else {
                get_template_part('includes/no-results', 'index');
            }
        }
        $posts = ob_get_contents();
        ob_end_clean();
        $class = " et_pb_module et_pb_bg_layout_{$background_layout}";
        $output = sprintf('<div%5$s class="%1$s%3$s%6$s"%7$s>
				%2$s
			%4$s', 'on' === $fullwidth ? 'et_pb_posts' : 'et_pb_blog_grid clearfix', $posts, esc_attr($class), !$container_is_closed ? '</div> <!-- .et_pb_posts -->' : '', '' !== $module_id ? sprintf(' id="%1$s"', esc_attr($module_id)) : '', '' !== $module_class ? sprintf(' %1$s', esc_attr($module_class)) : '', 'on' !== $fullwidth ? ' data-columns' : '');
        if ('on' !== $fullwidth) {
            $output = sprintf('<div class="et_pb_blog_grid_wrapper">%1$s</div>', $output);
        }
        return $output;
    }
</span>
						</div> <!-- end .featured-price -->
					<?php 
        }
        ?>
				</div> <!-- end .featured-image -->
				<div class="featured-description">
					<h2 class="featured-title  title-override"><a href="<?php 
        echo esc_url($featured_link);
        ?>
"><?php 
        the_title();
        ?>
</a></h2>
					<p><?php 
        truncate_post(190);
        ?>
</p>
					<a href="<?php 
        echo esc_url($featured_link);
        ?>
" class="readmore"><span><?php 
        esc_html_e('More Info', 'Boutique');
        ?>
</span></a>

					<?php 
        if ('false' == $featured_use_pages) {
            do_action('boutique_featured_product');
        }
        ?>
Exemple #26
0
" title="<?php 
        printf(esc_attr__('Permanent Link to %s', 'Bold'), get_the_title());
        ?>
">
				<?php 
        print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext);
        ?>
			</a>
    </div>
	<?php 
    }
    ?>
	
	<div>
	<?php 
    truncate_post(200);
    ?>
    </div>
    <a href="<?php 
    the_permalink();
    ?>
" rel="bookmark" class="featured-readmore" title="<?php 
    the_permalink();
    ?>
" title="<?php 
    printf(esc_attr__('Permanent Link to %s', 'Bold'), get_the_title());
    ?>
">
    <?php 
    esc_html_e('read more', 'Bold');
    ?>
Exemple #27
0
    function et_pb_blog($atts)
    {
        extract(shortcode_atts(array('module_id' => '', 'module_class' => '', 'fullwidth' => 'on', 'posts_number' => 10, 'include_categories' => '', 'meta_date' => 'M j, Y', 'show_thumbnail' => 'on', 'show_content' => 'off', 'show_author' => 'on', 'show_date' => 'on', 'show_categories' => 'on', 'show_pagination' => 'on', 'background_layout' => 'light', 'show_more' => 'off'), $atts));
        global $paged;
        $container_is_closed = false;
        if ('on' !== $fullwidth) {
            wp_enqueue_script('jquery-masonry-3');
        }
        $args = array('posts_per_page' => (int) $posts_number);
        $et_paged = is_front_page() ? get_query_var('page') : get_query_var('paged');
        if (is_front_page()) {
            $paged = $et_paged;
        }
        if ('' !== $include_categories) {
            $args['cat'] = $include_categories;
        }
        if (!is_search()) {
            $args['paged'] = $et_paged;
        }
        ob_start();
        query_posts($args);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                $post_format = get_post_format();
                $thumb = '';
                $width = 'on' === $fullwidth ? 1080 : 400;
                $width = (int) apply_filters('et_pb_blog_image_width', $width);
                $height = 'on' === $fullwidth ? 675 : 250;
                $height = (int) apply_filters('et_pb_blog_image_height', $height);
                $classtext = 'on' === $fullwidth ? 'et_pb_post_main_image' : '';
                $titletext = get_the_title();
                $thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Blogimage');
                $thumb = $thumbnail["thumb"];
                $no_thumb_class = '' === $thumb || 'off' === $show_thumbnail ? ' et_pb_no_thumb' : '';
                if (in_array($post_format, array('video', 'gallery'))) {
                    $no_thumb_class = '';
                }
                ?>

			<article id="post-<?php 
                the_ID();
                ?>
" <?php 
                post_class('et_pb_post' . $no_thumb_class);
                ?>
>

			<?php 
                et_divi_post_format_content();
                if (!in_array($post_format, array('link', 'audio', 'quote'))) {
                    if ('video' === $post_format && false !== ($first_video = et_get_first_video())) {
                        printf('<div class="et_main_video_container">
								%1$s
							</div>', $first_video);
                    } elseif ('gallery' === $post_format) {
                        et_gallery_images();
                    } elseif ('' !== $thumb && 'on' === $show_thumbnail) {
                        if ('on' !== $fullwidth) {
                            echo '<div class="et_pb_image_container">';
                        }
                        ?>
							<a href="<?php 
                        the_permalink();
                        ?>
">
								<?php 
                        print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height);
                        ?>
							</a>
					<?php 
                        if ('on' !== $fullwidth) {
                            echo '</div> <!-- .et_pb_image_container -->';
                        }
                    }
                }
                ?>
	<div class="article_info">
			<?php 
                if ('off' === $fullwidth || !in_array($post_format, array('link', 'audio', 'quote', 'gallery'))) {
                    ?>
				<?php 
                    if (!in_array($post_format, array('link', 'audio'))) {
                        ?>
					
					<p class="post-meta"><?php 
                        echo get_the_date($meta_date);
                        ?>
</p>
					<h2><a href="<?php 
                        the_permalink();
                        ?>
"><?php 
                        the_title();
                        ?>
</a></h2>
				<?php 
                    }
                    ?>

				<?php 
                    /*
                    if ( 'on' === $show_author || 'on' === $show_date || 'on' === $show_categories ) {
                    	printf( '<p class="post-meta">%1$s %2$s %3$s %4$s %5$s</p>',
                    		(
                    			'on' === $show_author
                    				? sprintf( __( 'by %s', 'Divi' ), et_get_the_author_posts_link() )
                    				: ''
                    		),
                    		(
                    			( 'on' === $show_author && 'on' === $show_date )
                    				? ' | '
                    				: ''
                    		),
                    		(
                    			'onn' === $show_date
                    				? sprintf( __( '%s', 'Divi' ), get_the_date( $meta_date ) )
                    				: ''
                    		),
                    		(
                    			(( 'on' === $show_author || 'on' === $show_date ) && 'on' === $show_categories)
                    				? ' | '
                    				: ''
                    		),
                    		(
                    			'on' === $show_categories
                    				? get_the_category_list(', ')
                    				: ''
                    		)
                    	);
                    }
                    */
                    if ('on' === $show_content) {
                        global $more;
                        $more = null;
                        the_content(__('read more...', 'Divi'));
                    } else {
                        if (has_excerpt()) {
                            the_excerpt();
                        } else {
                            truncate_post(270);
                        }
                        $more = 'on' == $show_more ? sprintf(' <a href="%1$s" class="more-link" >%2$s</a>', esc_url(get_permalink()), __('read more', 'Divi')) : '';
                        echo $more;
                    }
                    ?>
			<?php 
                }
                // 'off' === $fullwidth || ! in_array( $post_format, array( 'link', 'audio', 'quote', 'gallery'
                ?>
	</div>
			</article> <!-- .et_pb_post -->
	<?php 
            }
            // endwhile
            if ('on' === $show_pagination && !is_search()) {
                echo '</div> <!-- .et_pb_posts -->';
                $container_is_closed = true;
                if (function_exists('wp_pagenavi')) {
                    wp_pagenavi();
                } else {
                    get_template_part('includes/navigation', 'index');
                }
            }
            wp_reset_query();
        } else {
            get_template_part('includes/no-results', 'index');
        }
        $posts = ob_get_contents();
        ob_end_clean();
        $class = " et_pb_bg_layout_{$background_layout}";
        $output = sprintf('<div%5$s class="%1$s%3$s%6$s">
				%2$s
			%4$s', 'on' === $fullwidth ? 'et_pb_posts' : 'et_pb_blog_grid clearfix', $posts, esc_attr($class), !$container_is_closed ? '</div> <!-- .et_pb_posts -->' : '', '' !== $module_id ? sprintf(' id="%1$s"', esc_attr($module_id)) : '', '' !== $module_class ? sprintf(' %1$s', esc_attr($module_class)) : '');
        if ('on' !== $fullwidth) {
            $output = sprintf('<div class="et_pb_blog_grid_wrapper">%1$s</div>', $output);
        }
        return $output;
    }
Exemple #28
0
                ?>
						<h2><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h2>
					<?php 
            }
            ?>

					<?php 
            et_divi_post_meta();
            if ('on' !== et_get_option('divi_blog_style', 'false') || is_search() && 'on' === get_post_meta(get_the_ID(), '_et_pb_use_builder', true)) {
                truncate_post(270);
            } else {
                the_content();
            }
            ?>
				<?php 
        }
        ?>

					</article> <!-- .et_pb_post -->
			<?php 
    }
    if (function_exists('wp_pagenavi')) {
        wp_pagenavi();
    } else {
        get_template_part('includes/navigation', 'index');
                    print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext);
                    ?>
								<a href="<?php 
                    the_permalink();
                    ?>
"><span class="overlay"></span></a>
							</div> <!-- end .thumb -->
						<?php 
                }
                ?>
						
						<?php 
                if (!$et_ptemplate_blogstyle) {
                    ?>
							<p><?php 
                    truncate_post(550);
                    ?>
</p>
							<a href="<?php 
                    the_permalink();
                    ?>
" class="readmore"><span><?php 
                    esc_html_e('read more', 'Modest');
                    ?>
</span></a>
						<?php 
                } else {
                    ?>
							<?php 
                    global $more;
                    $more = 0;
					<?php 
            print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext);
            ?>
					<span class="post-overlay"></span>
				</a>
			</div> 	<!-- end .post-thumbnail -->
		<?php 
        }
        ?>
		<?php 
        if (get_option('mycuisine_blog_style') == 'on') {
            the_content('');
        } else {
            ?>
			<p><?php 
            truncate_post(520);
            ?>
</p>
		<?php 
        }
        ?>
		<a href="<?php 
        the_permalink();
        ?>
" class="readmore"><span><?php 
        esc_html_e('Read More', 'MyCuisine');
        ?>
</span></a>
	</div> 	<!-- end .post-->
<?php 
    }