Esempio n. 1
0
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', empty($instance['title']) ? 'Photostream' : $instance['title']);
        $posts_number = empty($instance['posts_number']) ? '' : $instance['posts_number'];
        $blog_category = empty($instance['blog_category']) ? '' : $instance['blog_category'];
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        ?>
	<div class="photostream clearfix">
		<?php 
        query_posts("showposts=" . $posts_number . "&cat=" . $blog_category);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                ?>
			
				<?php 
                $thumb = '';
                $width = 67;
                $height = 67;
                $classtext = 'post-thumb';
                $titletext = get_the_title();
                $thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Entry');
                $thumb = $thumbnail["thumb"];
                ?>
			
				<div class="thumb">
					<a href="<?php 
                the_permalink();
                ?>
">
						<?php 
                print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext);
                ?>
						<span class="overlay"></span>
					</a>
				</div> 	<!-- end .post-thumbnail -->
		<?php 
            }
        }
        wp_reset_query();
        ?>
	</div> <!-- end .photostream -->
<?php 
        echo $after_widget;
    }
Esempio n. 2
0
 function bt_slides_funcs($atts, $content)
 {
     extract(shortcode_atts(array('id' => '0', 'type' => 'carousel', 'auto' => '0'), $atts));
     if ((int) $id <= 0) {
         return '';
     }
     $_rand_id = 'carousel_' . rand();
     $portfolio_sliders = get_post_meta($id, THEME_SLUG . '_portfolio_slider', true);
     $portfolio_sliders = unserialize($portfolio_sliders);
     $portfolio_slider_config = get_post_meta($id, THEME_SLUG . '_portfolio_slider_config', true);
     $portfolio_slider_config = unserialize($portfolio_slider_config);
     if (is_array($portfolio_slider_config) && count($portfolio_slider_config) > 0) {
         $portfolio_slider_config_width = (int) $portfolio_slider_config['portfolio_slider_config_width'];
         $portfolio_slider_config_height = (int) $portfolio_slider_config['portfolio_slider_config_height'];
     }
     $control_html = $slides_html = '';
     $active_class = "active";
     foreach ($portfolio_sliders as $index => $_this_slider) {
         $img_html = '';
         $crop_img = $_this_slider['image_url'];
         if ($portfolio_slider_config_width > 0) {
             $img_html .= " width=\"{$portfolio_slider_config_width}\"";
             $crop_img = print_thumbnail($_this_slider['image_url'], true, '', $portfolio_slider_config_width, '', '', false, true);
         }
         if ($portfolio_slider_config_height > 0) {
             $img_html .= " height=\"{$portfolio_slider_config_height}\"";
             $crop_img = print_thumbnail($_this_slider['image_url'], true, '', '', $portfolio_slider_config_height, '', false, true);
         }
         if ($portfolio_slider_config_height > 0 && $portfolio_slider_config_width > 0) {
             $crop_img = print_thumbnail($_this_slider['image_url'], true, '', $portfolio_slider_config_width, $portfolio_slider_config_height, '', false, true);
         }
         $control_html .= "<li data-target=\"#{$_rand_id}\" data-slide-to=\"{$index}\" class=\"{$active_class}\"></li>";
         $slides_html .= "\n\t\t\t\t<div class=\"item {$active_class}\">\n\t\t\t\t\t\t<img src=\"{$crop_img}\" alt=\"{$_this_slider['alt']}\" title=\"{$_this_slider['title']}\" {$img_html}>\n                    <div class=\"carousel-caption\">\n\t\t\t\t\t\t<a href=\"{$_this_slider['url']}\"><h4>{$_this_slider['slide_title']}</h4></a>\n\t\t\t\t\t\t<p>{$_this_slider['slide_content']}</p>\n                    </div>\n                </div>";
         $active_class = '';
     }
     $control_html = "<ol class=\"carousel-indicators\">" . $control_html . "</ol>";
     $slides_html = "<div class=\"carousel-inner\">" . $slides_html . "</div>";
     $end_html = "\n\t\t    <a class=\"left carousel-control\" href=\"#{$_rand_id}\" data-slide=\"prev\">&lsaquo;</a>\n            <a class=\"right carousel-control\" href=\"#{$_rand_id}\" data-slide=\"next\">&rsaquo;</a>\n\t\t";
     $result = "<div class='carousel slide' id='{$_rand_id}'>{$control_html}{$slides_html}{$end_html}</div>";
     return $result;
 }
Esempio n. 3
0
<?php 
}
?>
</div> <!-- end #featured -->

<div id="controllers" class="clearfix">
	<ul>
		<?php 
for ($i = 0; $i < $featured_num; $i++) {
    ?>
			<li>
				<div class="controller">
					<a href="#"<?php 
    if ($i == 0) {
        echo ' class="active"';
    }
    ?>
>
						<?php 
    print_thumbnail($arr[$i]['thumbnail']['thumb'], $arr[$i]['thumbnail']["use_timthumb"], $arr[$i]['titletext'], $small_width, $small_height);
    ?>
						<span class="overlay"></span>
					</a>
				</div>	
			</li>
		<?php 
}
?>
	</ul>
	<div id="active_item"></div>
</div> <!-- end #controllers -->
Esempio n. 4
0
    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'];
        $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'];
        $overlay_icon_color = $this->shortcode_atts['overlay_icon_color'];
        $hover_overlay_color = $this->shortcode_atts['hover_overlay_color'];
        $hover_icon = $this->shortcode_atts['hover_icon'];
        $use_overlay = $this->shortcode_atts['use_overlay'];
        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 ('' !== $overlay_icon_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%% .et_overlay:before', 'declaration' => sprintf('color: %1$s !important;', esc_html($overlay_icon_color))));
        }
        if ('' !== $hover_overlay_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%% .et_overlay', 'declaration' => sprintf('background-color: %1$s;', esc_html($hover_overlay_color))));
        }
        if ('on' === $use_overlay) {
            $data_icon = '' !== $hover_icon ? sprintf(' data-icon="%1$s"', esc_attr(et_pb_process_font_icon($hover_icon))) : '';
            $overlay_output = sprintf('<span class="et_overlay%1$s"%2$s></span>', '' !== $hover_icon ? ' et_pb_inline_icon' : '', $data_icon);
        }
        $overlay_class = 'on' === $use_overlay ? ' et_pb_has_overlay' : '';
        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 clearfix' . $no_thumb_class . $overlay_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 
                        esc_url(the_permalink());
                        ?>
" class="entry-featured-image-url">
								<?php 
                        print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height);
                        ?>
								<?php 
                        if ('on' === $use_overlay) {
                            echo $overlay_output;
                        }
                        ?>
							</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 
                        esc_url(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 ? et_get_safe_localization(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 ? et_get_safe_localization(sprintf(__('%s', 'et_builder'), '<span class="published">' . esc_html(get_the_date($meta_date)) . '</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(esc_html(_nx('1 Comment', '%s Comments', get_comments_number(), 'number of comments', 'et_builder')), number_format_i18n(get_comments_number())) : '');
                    }
                    echo '<div class="post-content">';
                    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;
                            $post_content = et_strip_shortcodes(et_delete_post_first_video(get_the_content()));
                            echo apply_filters('the_content', $post_content);
                        } else {
                            $more = null;
                            echo apply_filters('the_content', et_strip_shortcodes(et_delete_post_first_video(get_the_content(esc_html__('read more...', 'et_builder')))));
                        }
                    } else {
                        if (has_excerpt()) {
                            echo et_strip_shortcodes(get_the_excerpt());
                        } else {
                            echo wpautop(et_delete_post_first_video(truncate_post(270, false, '', true)));
                        }
                    }
                    if ('on' !== $show_content) {
                        $more = 'on' == $show_more ? sprintf(' <a href="%1$s" class="more-link" >%2$s</a>', esc_url(get_permalink()), esc_html__('read more', 'et_builder')) : '';
                        echo $more;
                    }
                    echo '</div>';
                    ?>
			<?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 {
                    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);
        }
        // Restore $wp_filter
        $wp_filter = $wp_filter_cache;
        unset($wp_filter_cache);
        return $output;
    }
Esempio n. 5
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;
    }
    $post_id = get_the_ID();
    $slide_more_link = get_post_meta($post_id, '_et_slide_more_link', true);
    $more_link = '' != $slide_more_link ? $slide_more_link : get_permalink();
    $width = (int) apply_filters('et_slider_image_width', 539);
    $height = (int) apply_filters('et_slider_image_height', 480);
    $title = get_the_title();
    $thumbnail = get_thumbnail($width, $height, '', $title, $title, false, 'Featured');
    $thumb = $thumbnail["thumb"];
    ?>
		<div class="et-slide">
			<a href="<?php 
    echo esc_url($more_link);
    ?>
">
				<?php 
    print_thumbnail($thumb, $thumbnail["use_timthumb"], $title, $width, $height, 'et-main-image');
    ?>
			</a>

			<div class="et-description">
				<h2><a href="<?php 
    echo esc_url($more_link);
    ?>
"><?php 
    the_title();
    ?>
</a></h2>
				<p><?php 
    truncate_post(170);
    ?>
</p>
            while (have_posts()) {
                the_post();
                ?>

						<?php 
                $width = 207;
                $height = 136;
                $titletext = get_the_title();
                $thumbnail = get_thumbnail($width, $height, 'portfolio', $titletext, $titletext, true, 'Portfolio');
                $thumb = $thumbnail["thumb"];
                ?>

						<div class="et_pt_gallery_entry">
							<div class="et_pt_item_image">
								<?php 
                print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, 'portfolio');
                ?>
								<span class="overlay"></span>

								<a class="zoom-icon fancybox" title="<?php 
                the_title_attribute();
                ?>
" rel="gallery" href="<?php 
                echo $thumbnail['fullpath'];
                ?>
"><?php 
                esc_html_e('Zoom in', 'MyCuisine');
                ?>
</a>
								<a class="more-icon" href="<?php 
                the_permalink();
Esempio n. 8
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;
}
Esempio n. 9
0
        esc_html_e('Read More', 'Fusion');
    }
    ?>
					</a>
				</div> <!-- .description -->

			<?php 
    $width = (int) apply_filters('slider_image_width', 535);
    $height = (int) apply_filters('slider_image_height', 572);
    $title = get_the_title();
    $thumbnail = get_thumbnail($width, $height, '', $title, $title, false, 'Featured');
    $thumb = $thumbnail["thumb"];
    ?>
				<div class="featured-image">
					<a href="<?php 
    the_permalink();
    ?>
"><?php 
    print_thumbnail($thumb, $thumbnail["use_timthumb"], $title, $width, $height, '');
    ?>
</a>
				</div> <!-- .featured-image -->
			</div> <!-- .container -->
		</div> <!-- .et-slide -->
	<?php 
}
wp_reset_postdata();
?>

	</div> <!-- #et-slides -->
</div> <!-- #et-slider-wrapper -->
Esempio n. 10
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'];
        $show_title = $this->shortcode_atts['show_title'];
        $show_categories = $this->shortcode_atts['show_categories'];
        $show_pagination = $this->shortcode_atts['show_pagination'];
        $background_layout = $this->shortcode_atts['background_layout'];
        $zoom_icon_color = $this->shortcode_atts['zoom_icon_color'];
        $hover_overlay_color = $this->shortcode_atts['hover_overlay_color'];
        $hover_icon = $this->shortcode_atts['hover_icon'];
        global $paged;
        $module_class = ET_Builder_Element::add_module_order_class($module_class, $function_name);
        if ('' !== $zoom_icon_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%% .et_overlay:before', 'declaration' => sprintf('color: %1$s !important;', esc_html($zoom_icon_color))));
        }
        if ('' !== $hover_overlay_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%% .et_overlay', 'declaration' => sprintf('background-color: %1$s;', esc_html($hover_overlay_color))));
        }
        $container_is_closed = false;
        $args = array('posts_per_page' => (int) $posts_number, 'post_type' => 'staff');
        $et_paged = is_front_page() ? get_query_var('page') : get_query_var('paged');
        if (is_front_page()) {
            $paged = $et_paged;
        }
        if ('' !== $include_categories) {
            $args['tax_query'] = array(array('taxonomy' => 'project_category', 'field' => 'id', 'terms' => explode(',', $include_categories), 'operator' => 'IN'));
        }
        if (!is_search()) {
            $args['paged'] = $et_paged;
        }
        $main_post_class = sprintf('et_pb_portfolio_item%1$s', 'on' !== $fullwidth ? ' et_pb_grid_item' : '');
        ob_start();
        query_posts($args);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                ?>

				<div id="post-<?php 
                the_ID();
                ?>
" <?php 
                post_class($main_post_class);
                ?>
>

			<?php 
                $thumb = '';
                $width = 'on' === $fullwidth ? 1080 : 400;
                $width = (int) apply_filters('et_pb_portfolio_image_width', $width);
                $height = 'on' === $fullwidth ? 9999 : 284;
                $height = (int) apply_filters('et_pb_portfolio_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"];
                if ('' !== $thumb) {
                    ?>
					<a href="<?php 
                    the_permalink();
                    ?>
">
					<?php 
                    if ('on' !== $fullwidth) {
                        ?>
						<span class="et_portfolio_image">
					<?php 
                    }
                    ?>
							<?php 
                    print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height);
                    ?>
					<?php 
                    if ('on' !== $fullwidth) {
                        $data_icon = '' !== $hover_icon ? sprintf(' data-icon="%1$s"', esc_attr(et_pb_process_font_icon($hover_icon))) : '';
                        printf('<span class="et_overlay%1$s"%2$s></span>', '' !== $hover_icon ? ' et_pb_inline_icon' : '', $data_icon);
                        ?>
						</span>
					<?php 
                    }
                    ?>
					</a>
			<?php 
                }
                ?>

				<?php 
                if ('on' === $show_title) {
                    ?>
					<h2><a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h2>
					<h3>et_pb_position</h3>
				<?php 
                }
                ?>

				<?php 
                if ('on' === $show_categories) {
                    ?>
					<p class="post-meta"><?php 
                    echo get_the_term_list(get_the_ID(), 'project_category', '', ', ');
                    ?>
</p>
				<?php 
                }
                ?>

				</div> <!-- .et_pb_portfolio_item -->
	<?php 
            }
            if ('on' === $show_pagination && !is_search()) {
                echo '</div> <!-- .et_pb_portfolio -->';
                $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">
				%2$s
			%4$s', 'on' === $fullwidth ? 'et_pb_portfolio' : 'et_pb_portfolio_grid clearfix', $posts, esc_attr($class), !$container_is_closed ? '</div> <!-- .et_pb_portfolio -->' : '', '' !== $module_id ? sprintf(' id="%1$s"', esc_attr($module_id)) : '', '' !== $module_class ? sprintf(' %1$s', esc_attr($module_class)) : '');
        return $output;
    }
Esempio n. 11
0
				
				<?php 
for ($i = 1; $i <= $featured_num; $i++) {
    ?>
					<div class="item<?php 
    if ($i == 1) {
        echo ' active';
    }
    if ($i == $featured_num) {
        echo ' last';
    }
    ?>
">
						<a href="#" class="product">
							<?php 
    print_thumbnail($arr[$i]["thumb_small"], $arr[$i]["use_timthumb"], $arr[$i]["fulltitle"], $width_small, $height_small);
    ?>
							<?php 
    if ($arr[$i]["price"] != '') {
        ?>
								<span class="tag"><span><?php 
        echo esc_html($arr[$i]["price"]);
        ?>
</span></span>
							<?php 
    }
    ?>
						</a>
					</div> <!-- .item -->
				<?php 
}
Esempio n. 12
0
    function recent_works_function($atts, $content = false)
    {
        extract(shortcode_atts(array('count_items' => '10', 'show_items' => 4, 'gallery' => ''), $atts));
        wp_reset_query();
        $args = array('post_type' => 'portfolio', 'showposts' => $count_items);
        if (strlen($gallery) > 0) {
            $args = array('post_type' => 'portfolio', 'showposts' => $count_items, 'tax_query' => array(array('taxonomy' => 'gallery', 'field' => 'slug', 'terms' => $gallery)));
        }
        $num_count = count(query_posts($args));
        if (have_posts()) {
            $id_widget = 'recent-works-shortcode' . rand(0, 1000);
            ob_start();
            ?>
			
			<div id="<?php 
            echo $id_widget;
            ?>
" class="shortcode-recent-works flexslider">
				<div class="slider-div">
					<ul class="slides">
					<?php 
            $i = 0;
            while (have_posts()) {
                the_post();
                global $post;
                ?>
							<li class="item<?php 
                if ($i == 0) {
                    echo ' first';
                }
                if (++$i == $num_count) {
                    echo ' last';
                }
                ?>
">
								<?php 
                $thumb_arr = get_thumbnail(300, 170, '', get_the_title(), get_the_title());
                $thumb = $thumb_arr["fullpath"];
                $url_video = get_post_meta($post->ID, THEME_SLUG . 'video_portfolio', true);
                if (strlen(trim($url_video)) > 0) {
                    if (strstr($url_video, 'youtube.com') || strstr($url_video, 'youtu.be')) {
                        $thumburl = array(get_thumbnail_video_src($url_video, 500, 500));
                        $item_class = "thumb-video youtube-fancy";
                    }
                    if (strstr($url_video, 'vimeo.com')) {
                        $thumburl = array(wp_parse_thumbnail_vimeo(wp_parse_vimeo_link($url_video), 500, 500));
                        $item_class = "thumb-video vimeo-fancy";
                    }
                    $light_box_url = $url_video;
                } else {
                    $thumb = get_post_thumbnail_id($post->ID);
                    $thumburl = wp_get_attachment_image_src($thumb, 'full');
                    $item_class = "thumb-image";
                    $light_box_url = $thumburl[0];
                }
                ?>
								<div class="image <?php 
                echo $id_widget;
                ?>
">
									<a class="thumbnail" href="<?php 
                the_permalink();
                ?>
"><?php 
                echo print_thumbnail($thumburl[0], true, $post_title, 500, 330);
                ?>
</a>
									<div class="icons">
										<div>
											<a class="zoom-gallery fancybox" title="<?php 
                echo get_the_title();
                ?>
" rel="fancybox" href="<?php 
                echo $light_box_url;
                ?>
"></a>
											<a class="link-gallery " title="<?php 
                echo get_the_title();
                ?>
" href="<?php 
                echo get_permalink();
                ?>
"></a>
										</div>
									</div>	
								</div>
								<div class="detail<?php 
                if (!$thumb) {
                    echo ' noimage';
                }
                ?>
">
									<p class="title"><h4 class="heading-title"><a  class="wpt_title" href="<?php 
                echo get_permalink($post->ID);
                ?>
"><?php 
                echo get_the_title($post->ID);
                ?>
</a></h4></p>
									<span class="author-time"><span class="author"><?php 
                the_author();
                ?>
</span><b>/</b><span class="time"><?php 
                the_time('F d,Y');
                ?>
</span><b>/</b><span class="comment-number"><?php 
                comments_number('0 Comments', '1 Comment', '% Comments');
                ?>
</span></span>
								</div>							
							</li>
					<?php 
            }
            ?>
					</ul>
				</div>
			</div>
			<div id="<?php 
            echo $id_widget;
            ?>
_clone" style="display:none;" class="shortcode-recent-works flexslider">
			</div>
			
			<script type="text/javascript">
				jQuery(document).ready(function() {
					flex_carousel_slide('#<?php 
            echo $id_widget;
            ?>
',<?php 
            echo $show_items;
            ?>
);
				});
			</script>
			<?php 
            $ret_html = ob_get_contents();
            ob_end_clean();
            //ob_end_flush();
        }
        wp_reset_query();
        return $ret_html;
    }
Esempio n. 13
0
<?php 
}
?>
</div> <!-- end #featured -->

<div id="controllers" class="clearfix">
	<ul>
		<?php 
for ($i = 0; $i < $featured_num; $i++) {
    ?>
			<li>
				<div class="controller">
					<a href="#"<?php 
    if ($i == 0) {
        echo ' class="active"';
    }
    ?>
>
						<?php 
    print_thumbnail(array('thumbnail' => $arr[$i]["thumbnail"]["thumb"], 'use_timthumb' => $arr[$i]["thumbnail"]["use_timthumb"], 'alttext' => $arr[$i]["titletext"], 'width' => (int) $small_width, 'height' => (int) $small_height, 'et_post_id' => $arr[$i]['post_id']));
    ?>
						<span class="overlay"></span>
					</a>
				</div>
			</li>
		<?php 
}
?>
	</ul>
	<div id="active_item"></div>
</div> <!-- end #controllers -->
Esempio n. 14
0
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', empty($instance['title']) ? 'Recent From ' : $instance['title']);
        $posts_number = empty($instance['posts_number']) ? '' : (int) $instance['posts_number'];
        $blog_category = empty($instance['blog_category']) ? '' : (int) $instance['blog_category'];
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        ?>
		<?php 
        query_posts("posts_per_page=" . $posts_number . "&cat=" . $blog_category);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                ?>
			<div class="block-post clearfix">
				<?php 
                $thumb = '';
                $width = 40;
                $height = 40;
                $classtext = 'post-image';
                $titletext = get_the_title();
                $thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Recent');
                $thumb = $thumbnail["thumb"];
                ?>

				<?php 
                if ($thumb != '' && get_option('aggregate_thumbnails_index') == 'on') {
                    ?>
					<div class="thumb">
						<a href="<?php 
                    the_permalink();
                    ?>
">
							<?php 
                    print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext);
                    ?>
							<span class="overlay"></span>
						</a>
					</div> 	<!-- end .post-thumbnail -->
				<?php 
                }
                ?>

				<h3 class="title"><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h3>
				<p class="meta-info"><?php 
                esc_html_e('Posted', 'Aggregate');
                ?>
 <?php 
                esc_html_e('by', 'Aggregate');
                ?>
 <?php 
                the_author_posts_link();
                ?>
 <?php 
                esc_html_e('on', 'Aggregate');
                ?>
 <?php 
                the_time('n-j-y');
                ?>
</p>
			</div> <!-- end .block-post -->
		<?php 
            }
        }
        wp_reset_query();
        ?>

	<a href="<?php 
        echo esc_url(get_category_link($blog_category));
        ?>
" class="more"><span><?php 
        esc_html_e('More From ', 'Aggregate');
        echo get_categname($blog_category);
        ?>
</span></a>
<?php 
        echo $after_widget;
    }
Esempio n. 15
0
	
	<?php 
for ($i = 1; $i <= $featured_num; $i++) {
    ?>
		<div class="slide<?php 
    if ($i == 1) {
        echo ' active';
    }
    ?>
" style="background: <?php 
    if ($arr[$i]["color"] != '') {
        echo '#' . esc_attr($arr[$i]["color"]);
    }
    ?>
 url('<?php 
    print_thumbnail($arr[$i]["thumb"], $arr[$i]["use_timthumb"], $arr[$i]["fulltitle"], $width, $height, '', true, true);
    ?>
') no-repeat top center;">
			<div class="container<?php 
    if ($arr[$i]['variation'] == 2) {
        echo ' descright';
    }
    ?>
">
				<div class="description">
					<h2 class="title"><a href="<?php 
    echo esc_url($arr[$i]["permalink"]);
    ?>
"><?php 
    echo esc_html($arr[$i]["fulltitle"]);
    ?>
Esempio n. 16
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;
    }
$thumb = $thumbnail['thumb'];
if (!is_page() && $thumb != '' && get_option('thestyle_blog_thumbnails') == 'on' || is_page() && $thumb != '' && get_option('thestyle_page_thumbnails') == 'on') {
    ?>
	<div class="single-thumb">
		<?php 
    if (!is_single() && !is_page()) {
        ?>
			<a href="<?php 
        the_permalink();
        ?>
">
		<?php 
    }
    ?>
			<?php 
    print_thumbnail($thumb, $thumbnail['use_timthumb'], $titletext, $width, $height);
    ?>
			<span class="overlay"></span>
			<?php 
    if (!is_page()) {
        ?>
				<div class="category"><?php 
        the_category();
        ?>
</div>
				<span class="month"><?php 
        the_time('M');
        ?>
<span class="date"><?php 
        the_time('d');
        ?>
Esempio n. 18
0
            $width = 462;
            $height = 306;
            ?>
				<div class="slide<?php 
            echo $et_slide_class;
            ?>
">
					<a href="<?php 
            echo $et_link;
            ?>
" class="main">
						<?php 
            $post_title = get_the_title();
            $thumbnail = get_thumbnail($width, $height, 'thumb', $post_title, $post_title);
            $thumb = $thumbnail["thumb"];
            print_thumbnail($thumb, $thumbnail["use_timthumb"], $post_title, $width, $height, 'Featured');
            ?>
					</a>
					
					<h2 class="featured-title"><?php 
            the_title();
            ?>
</h2>
					<div class="description">
						<p><?php 
            truncate_post(200);
            ?>
 <?php 
            #global $more;
            #$more = 0;
            ?>
Esempio n. 19
0
	<?php 
for ($i = 1; $i <= $featured_num; $i++) {
    ?>
		<div class="slide<?php 
    if ($i == 1) {
        echo ' active';
    }
    ?>
" style="background: <?php 
    if ($arr[$i]["color"] != '') {
        echo '#' . esc_attr($arr[$i]["color"]);
    }
    ?>
 url('<?php 
    print_thumbnail(array('thumbnail' => $arr[$i]["thumbnail"]["thumb"], 'use_timthumb' => $arr[$i]["thumbnail"]["use_timthumb"], 'alttext' => $arr[$i]["fulltitle"], 'width' => (int) $width, 'height' => (int) $height, 'echoout' => true, 'forstyle' => true, 'et_post_id' => $arr[$i]['post_id']));
    ?>
') no-repeat top center;">
			<div class="container<?php 
    if ($arr[$i]['variation'] == 2) {
        echo ' descright';
    }
    ?>
">
				<div class="description">
					<h2 class="title"><a href="<?php 
    echo esc_url($arr[$i]["permalink"]);
    ?>
"><?php 
    echo esc_html($arr[$i]["fulltitle"]);
    ?>
Esempio n. 20
0
                $height = 56;
                $titletext = get_the_title();
                $thumbnail = get_thumbnail($width, $height, 'item-image', $titletext, $titletext, true, 'Work');
                $thumb = $thumbnail["thumb"];
                $fancybox_title = get_post_meta($post->ID, 'Customtitle', true) ? get_post_meta($post->ID, 'Customtitle', true) : get_the_title();
                ?>
							<div class="thumb">
								<a rel="gallery" title="<?php 
                echo esc_attr($fancybox_title);
                ?>
" href="<?php 
                echo esc_attr($thumbnail['fullpath']);
                ?>
" class="fancybox">
									<?php 
                print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, 'item-image');
                ?>
									<span class="overlay"></span>
									<span class="zoom-icon"></span>
								</a>
							</div> 	<!-- end .thumb -->
						<?php 
            }
        }
        nxt_reset_query();
        ?>
				</div> <!-- end .blurb -->
			<?php 
    }
    ?>
		</div> <!-- end #blurbs -->
Esempio n. 21
0
function et_pb_filterable_portfolio($atts)
{
    extract(shortcode_atts(array('module_id' => '', 'module_class' => '', 'fullwidth' => 'on', 'posts_number' => 10, 'include_categories' => '', 'show_title' => 'on', 'show_categories' => 'on', 'show_pagination' => 'on', 'background_layout' => 'light'), $atts));
    wp_enqueue_script('jquery-masonry-3');
    wp_enqueue_script('hashchange');
    $args = array();
    if ('on' === $show_pagination) {
        $args['nopaging'] = true;
    } else {
        $args['posts_per_page'] = (int) $posts_number;
    }
    if ('' !== $include_categories) {
        $args['tax_query'] = array(array('taxonomy' => 'project_category', 'field' => 'id', 'terms' => explode(',', $include_categories), 'operator' => 'IN'));
    }
    $projects = et_divi_get_projects($args);
    $categories_included = array();
    ob_start();
    if ($projects->post_count > 0) {
        while ($projects->have_posts()) {
            $projects->the_post();
            $category_classes = array();
            $categories = get_the_terms(get_the_ID(), 'project_category');
            if ($categories) {
                foreach ($categories as $category) {
                    $category_classes[] = 'project_category_' . $category->slug;
                    $categories_included[] = $category->term_id;
                }
            }
            $category_classes = implode(' ', $category_classes);
            ?>
			<div id="post-<?php 
            the_ID();
            ?>
" <?php 
            post_class('et_pb_portfolio_item ' . $category_classes);
            ?>
>
			<?php 
            $thumb = '';
            $width = 'on' === $fullwidth ? 1080 : 400;
            $width = (int) apply_filters('et_pb_portfolio_image_width', $width);
            $height = 'on' === $fullwidth ? 9999 : 284;
            $height = (int) apply_filters('et_pb_portfolio_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"];
            if ('' !== $thumb) {
                ?>
					<a href="<?php 
                the_permalink();
                ?>
">
					<?php 
                if ('on' !== $fullwidth) {
                    ?>
						<span class="et_portfolio_image">
					<?php 
                }
                ?>
							<?php 
                print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height);
                ?>
					<?php 
                if ('on' !== $fullwidth) {
                    ?>
							<span class="et_overlay"></span>
						</span>
					<?php 
                }
                ?>
					</a>
			<?php 
            }
            ?>

			<?php 
            if ('on' === $show_title) {
                ?>
				<h2><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h2>
			<?php 
            }
            ?>

			<?php 
            if ('on' === $show_categories) {
                ?>
				<p class="post-meta"><?php 
                echo get_the_term_list(get_the_ID(), 'project_category', '', ', ');
                ?>
</p>
			<?php 
            }
            ?>

			</div><!-- .et_pb_portfolio_item -->
			<?php 
        }
    }
    wp_reset_postdata();
    $posts = ob_get_clean();
    $categories_included = explode(',', $include_categories);
    $terms_args = array('include' => $categories_included, 'orderby' => 'name', 'order' => 'ASC');
    $terms = get_terms('project_category', $terms_args);
    $category_filters = '<ul class="clearfix">';
    $category_filters .= sprintf('<li class="et_pb_portfolio_filter et_pb_portfolio_filter_all"><a href="#" class="active" data-category-slug="all">%1$s</a></li>', esc_html__('All', 'Divi'));
    foreach ($terms as $term) {
        $category_filters .= sprintf('<li class="et_pb_portfolio_filter"><a href="#" data-category-slug="%1$s">%2$s</a></li>', esc_attr($term->slug), esc_html($term->name));
    }
    $category_filters .= '</ul>';
    $class = " et_pb_bg_layout_{$background_layout}";
    $output = sprintf('<div%5$s class="et_pb_filterable_portfolio %1$s%4$s%6$s" data-posts-number="%7$d">
			<div class="et_pb_portfolio_filters clearfix">%2$s</div><!-- .et_pb_portfolio_filters -->

			<div class="et_pb_portfolio_items_wrapper %8$s">
				<div class="column_width"></div>
				<div class="gutter_width"></div>
				<div class="et_pb_portfolio_items">%3$s</div><!-- .et_pb_portfolio_items -->
			</div>
			%9$s
		</div> <!-- .et_pb_filterable_portfolio -->', 'on' === $fullwidth ? 'et_pb_filterable_portfolio_fullwidth' : 'et_pb_filterable_portfolio_grid clearfix', $category_filters, $posts, esc_attr($class), '' !== $module_id ? sprintf(' id="%1$s"', esc_attr($module_id)) : '', '' !== $module_class ? sprintf(' %1$s', esc_attr($module_class)) : '', esc_attr($posts_number), 'on' === $show_pagination ? '' : 'no_pagination', 'on' === $show_pagination ? '<div class="et_pb_portofolio_pagination"></div>' : '');
    return $output;
}
Esempio n. 22
0
">
										<?php 
                } else {
                    ?>
											<a href="<?php 
                    echo esc_attr($thumbnail["fullpath"]);
                    ?>
" rel="media" class="fancybox" title="<?php 
                    echo esc_attr($titletext);
                    ?>
">
										<?php 
                }
                ?>
												<?php 
                print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, 'multi-media-image');
                ?>
												<span class="more"></span>
											</a>
										<div class="media-description">
											<p><?php 
                echo $et_media_description;
                ?>
</p>
											<span class="media-arrow"></span>
										</div>
									</div> 	<!-- end .thumb -->
							<?php 
                if ($media_current_post % 7 == 0) {
                    $media_open = false;
                    ?>
Esempio n. 23
0
						<?php 
                $thumb = '';
                $width = 184;
                $height = 184;
                $classtext = '';
                $titletext = get_the_title();
                $thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext);
                $thumb = $thumbnail["thumb"];
                ?>
						
						<?php 
                if ($thumb != '' && !$et_ptemplate_showthumb) {
                    ?>
							<div class="et_pt_thumb alignleft">
								<?php 
                    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);
Esempio n. 24
0
function et_template_loop_product_thumbnail()
{
    $thumb = '';
    $width = (int) apply_filters('et_product_image_width', 190);
    $height = (int) apply_filters('et_product_image_height', 190);
    $classtext = '';
    $titletext = get_the_title();
    $thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Product');
    $thumb = $thumbnail["thumb"];
    print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext);
}