Example #1
0
function get_thumbnail($dir)
{
    $list = lister($dir, FALSE);
    // we don't care about thumbs, so save some time
    if (isset($list['picture']['thumbnail.jpg']) === TRUE) {
        return 'thumbnail.jpg';
    } else {
        if (isset($list['picture']) === TRUE && sizeof($list['picture']) > 0) {
            // get first picture file in the folder
            $key = key($list['picture']);
            // get current value
            return $list['picture'][$key]['big'];
        } else {
            if (isset($list['folder']) === TRUE && sizeof($list['folder']) > 0) {
                // search in sub folders
                foreach ($list['folder'] as $a_folder) {
                    // recursivity FTW
                    $a_folder_thumb = get_thumbnail($dir . '/' . $a_folder);
                    if ($a_folder_thumb !== '') {
                        return $a_folder . '/' . $a_folder_thumb;
                    }
                }
            }
        }
    }
    return '';
    // nothing was found
}
    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;
    }
Example #3
0
function render_link($id, $title, $author, $app_id, $self = TRUE)
{
    $output = '<div class="tomove">';
    $output .= '<h2>' . $title . '</h2>';
    $output .= '<a ';
    if (!$self) {
        $output .= 'target="_blank" ';
    }
    $output .= 'href="' . $app_id . '">';
    $img = get_thumbnail($id);
    $output .= '<img alt="' . $title . ' by ' . $author . '" class="thumbnail img-responsive" src="' . $img . '" />';
    $output .= '</a>';
    //echo '<iframe type="text/html" width="640" height="390" src="http://www.youtube.com/embed/' . $obj->youtube_id . '" frameborder="0"/>';
    $output .= '<span class="label label-info">' . $author . '</span>';
    $output .= '</div>';
    return $output;
}
        $et_paged = is_front_page() ? get_query_var('page') : get_query_var('paged');
        ?>
					<?php 
        query_posts("posts_per_page={$et_ptemplate_gallery_perpage}&paged=" . $et_paged . $gallery_query);
        ?>
					<?php 
        if (have_posts()) {
            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'];
Example #5
0
        the_title();
        ?>
</h1>
						<span class="et_project_categories"><?php 
        echo get_the_term_list(get_the_ID(), 'project_category', '', ', ');
        ?>
</span>
					</div>

				<?php 
        $thumb = '';
        $width = (int) apply_filters('et_pb_portfolio_single_image_width', 1080);
        $height = (int) apply_filters('et_pb_portfolio_single_image_height', 9999);
        $classtext = 'et_featured_image';
        $titletext = get_the_title();
        $thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Projectimage');
        $thumb = $thumbnail["thumb"];
        $page_layout = get_post_meta(get_the_ID(), '_et_pb_page_layout', true);
        if ('' !== $thumb) {
            print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height);
        }
        ?>

				<?php 
    }
    ?>

					<div class="entry-content">
					<?php 
    the_content();
    if (!$is_page_builder_used) {
Example #6
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;
}
Example #7
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;
}
Example #8
0
}

if(isset($success))
{
    echo success_template('Image was successfully uploaded <a class="btn btn-sm btn-primary" href="'.current_url().'">Refresh page</a>');
}
?>


<input  type="hidden"  name="user_id" value="<?=$user_id?>" class="form-control" id="user_id" >


<div class="form-group">
    <label class="col-md-2 control-label"></label>
    <div class="col-md-10">
        <div class="fileinput-preview thumbnail" data-trigger="fileinput" style="width: 200px; height: 150px;"><img src="<?=base_url().'uploads/avatars/'.get_thumbnail($avatar)?>"></div>
        <?php
        $data = array
        (
            'name'        => 'userfile',
            'id'          => 'userfile',
            'value'       => set_value('userfile'),
            'maxlength'   => '',
            'size'        => '',
            'style'       => '',
            'class'       => 'fileinput btn-info',
            'data-filename-placement'   =>'inside',
            'title'                     =>'New filename goes inside'
        );

        echo form_upload($data);
<div id="content-area">
	<div class="container clearfix fullwidth">
		<div id="main-area">

<?php 
while (have_posts()) {
    the_post();
    ?>
	<article class="entry clearfix">
	<?php 
    $thumb = '';
    $width = (int) apply_filters('et_single_project_image_width', 9999);
    $height = (int) apply_filters('et_single_project_image_height', 9999);
    $classtext = 'et-main-project-thumb';
    $titletext = get_the_title();
    $thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'SingleProject');
    $thumb = $thumbnail["thumb"];
    print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext);
    the_content();
    et_gallery_images();
    wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'Vertex'), 'after' => '</div>'));
    ?>
	</article> <!-- .entry -->

	<?php 
    if (comments_open() && 'on' == et_get_option('vertex_show_postcomments', 'on')) {
        comments_template('', true);
    }
}
?>
Example #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'];
        $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;
    }
function delete_image($path, $image_name)
{
    //images to delete
    $items = array(get_thumbnail($image_name), $image_name);
    //delete only if exists
    foreach ($items as $item) {
        if (check_image_existance($path, $item)) {
            unlink($path . $item);
        }
    }
}
Example #12
0



    <div class="form-group">

        <div class="col-sm-9">
            <div class="fileinput fileinput-new" data-provides="fileinput">
                <div class="fileinput-preview thumbnail" data-trigger="fileinput" style="width: 200px; height: 150px;">
                    <?php
                    //if there is an image
                    if (get_blog_article_info_by_id($id, 'image'))
                    {
                        ?>
                        <img
                            src="<?= base_url() . 'uploads/blogs/' . get_thumbnail(get_blog_article_info_by_id($id, 'image')) ?>">
                    <?php
                    }
                    ?>

                </div>
                <div>

                        <?php
                        $data = array
                        (
                            'name'        => 'userfile',
                            'id'          => 'userfile',
                            'value'       => set_value('userfile'),
                            'maxlength'   => '',
                            'size'        => '',
Example #13
0
							<?php 
                    $testimonials_args = array('post_type' => array('testimonial'), 'showposts' => '1', 'orderby' => 'rand');
                    $testimonials_query = new WP_Query($testimonials_args);
                    while ($testimonials_query->have_posts()) {
                        $testimonials_query->the_post();
                        ?>
									<div class="testimonials-item">
										<div class="testimonials-item-bottom">
											<div class="testimonials-item-content">
												<?php 
                        $thumb = '';
                        $width = 56;
                        $height = 56;
                        $classtext = 'item-image';
                        $titletext = get_the_title();
                        $thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Testimonial');
                        $thumb = $thumbnail["thumb"];
                        ?>
												<?php 
                        if ($thumb != '') {
                            ?>
													<div class="thumb">
														<?php 
                            print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext);
                            ?>
														<span class="overlay"></span>
													</div> <!-- end .thumb -->
												<?php 
                        }
                        ?>
												<p class="author"><?php 
Example #14
0
 function et_fable_get_background()
 {
     if (has_post_format('gallery')) {
         return '';
     }
     $style = '';
     $post_bg_color = ($bg_color = get_post_meta(get_the_ID(), '_et_post_bg_color', true)) && '' !== $bg_color ? $bg_color : '#ffffff';
     $post_use_bg_color = 'on' === get_post_meta(get_the_ID(), '_et_use_bg_color', true) ? true : false;
     $background = array();
     $thumb = '';
     $width = (int) apply_filters('et_blog_image_width', 9999);
     $height = (int) apply_filters('et_blog_image_height', 9999);
     $classtext = '';
     $titletext = get_the_title();
     $thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Indeximage');
     $thumb = $thumbnail["thumb"];
     // Gallery posts use featured image for the picture in the video container
     // so don't allow it to use the featured image for background
     if ('' !== $thumb && !has_post_format('video')) {
         $background['image'] = $thumb;
     }
     if (isset($background['image'])) {
         $style = sprintf(' style="background-image: url(%s);"', esc_attr($background['image']));
     }
     // Attaches solid background color to the post if the featured image is not set
     // or 'Background Color instead of the Featured Image' is enabled
     if ('' === $style || $post_use_bg_color) {
         $style = sprintf(' style="background-color: %s;"', esc_attr($post_bg_color));
     }
     return $style;
 }
Example #15
0
		<?php 
get_template_part('includes/breadcrumbs', 'single');
?>

		<?php 
while (have_posts()) {
    the_post();
    ?>
			<div class="et-map-post">
			<?php 
    $thumb = '';
    $width = (int) apply_filters('et_single_listing_image_width', 960);
    $height = (int) apply_filters('et_single_listing_image_height', 320);
    $classtext = '';
    $titletext = get_the_title();
    $thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'ListingSingle');
    $thumb = $thumbnail["thumb"];
    ?>
			<?php 
    if ('' != $thumb) {
        ?>
				<div class="thumbnail">
					<?php 
        print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext);
        ?>

					<div class="et-description">
						<h1><?php 
        the_title();
        ?>
</h1>
Example #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;
    }
Example #17
0
    ?>
            <?php 
    if (!empty($p->quote)) {
        ?>
                <div class="featured-quote">
                    <blockquote><?php 
        echo $p->quote;
        ?>
</blockquote>
                </div>
            <?php 
    }
    ?>
            <div class="teaser-body" itemprop="articleBody">
                <?php 
    echo get_thumbnail($p->body);
    ?>
                <?php 
    echo get_teaser($p->body, $p->url);
    ?>
                <?php 
    if (config('teaser.type') === 'trimmed') {
        ?>
<a href="<?php 
        echo $p->url;
        ?>
">Read more</a><?php 
    }
    ?>
            </div>
        </div>
Example #18
0
                                    <a target="_blank" id="<?= encryptValue($row['id']) ?>" href="<?=$row['footer_link']?>" class="context-menu-one box menu-1">
                                        <?= ($row['footer_link']); ?> <i class="md md-link"></i>
                                    </a>



                                </td>

                                <td>
                                    <?php
                                    if($row['imageurl']){
                                        ?>
                                        <a href="<?= base_url() . 'uploads/footer_link_logos/' . $row['imageurl'] ?>"
                                           class="fancybox" title="<?= $row['title'] ?>">
                                            <img class="img-circle" width="32px" height="32px"
                                                 src="<?= base_url() ?>uploads/footer_link_logos/<?= get_thumbnail($row['imageurl']) ?>">
                                        </a>
                                    <?php
                                    }
                                    ?>


                                    <a href="<?=base_url().$this->uri->segment(1).'/'.$this->uri->segment(2).'/footer_link_logo/'.encryptValue($row['id'])?>"><?=$row['imageurl']!==''?'update':'upload'?> Logo</a> </td>

                            </tr>
                        <?php
                        }


                        ?>
    $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++) {
    ?>
		<div class="slide<?php 
Example #20
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;
    }
Example #21
0
    function quicksand_filter()
    {
        wp_reset_query();
        if ($_POST['filter'] == 'all') {
            $num_post = count(query_posts('post_type=' . $_POST['post_type'] . '&posts_per_page=' . $_POST['num_posts_per_page'] . '&paged=' . $_POST['page']));
        } else {
            $num_post = count(query_posts('meta_key=' . THEME_SLUG . 'type_portfolio&meta_value=' . $_POST['filter'] . '&post_type=' . $_POST['post_type'] . '&posts_per_page=' . $_POST['num_posts_per_page'] . '&paged=' . $_POST['page']));
        }
        $column_count = $_POST['column_count'];
        $width_thumb = $_POST['width_thumb'];
        $height_thumb = $_POST['height_thumb'];
        $i = 0;
        ?>
		<ul class="list-post">
		<?php 
        while (have_posts()) {
            the_post();
            global $post;
            $thumbnail = get_thumbnail($width_thumb, $height_thumb, '', get_the_title(), get_the_title());
            $thumb = $thumbnail["fullpath"];
            ?>
			<li class="item<?php 
            if ($i % $column_count == 0) {
                echo ' start';
            }
            if (++$i % $column_count == 0 || $i == $num_post) {
                echo ' end';
            }
            ?>
" data-id="<?php 
            echo $post->ID;
            ?>
" title="<?php 
            echo $i;
            ?>
">
				<?php 
            if ($thumb || ($video_link = get_post_meta($post->ID, THEME_SLUG . 'video_portfolio', true))) {
                ?>
				<div class="image image-style">
					<a class="thumbnail" href="<?php 
                the_permalink();
                ?>
">
						<?php 
                if ($thumb) {
                    the_post_thumbnail(array($width_thumb, $height_thumb), array('class' => 'thumbnail-effect-1'));
                } else {
                    echo get_thumbnail_video($video_link, $width_thumb, $height_thumb);
                }
                ?>
					</a>
					<?php 
                if ($_POST['lightbox'] == 'true') {
                    if ($video_link) {
                        show_light_box($post, 'fancybox-group', '', $_POST['id_group'] . '-' . $post->ID);
                    } else {
                        show_light_box($post, 'fancybox-group', 'lightbox-' . $_POST['id_group'], $_POST['id_group'] . '-' . $post->ID);
                    }
                }
                ?>
				</div>
				<?php 
            }
            ?>
				<div class="detail<?php 
            if (!$thumb && !$video_link) {
                echo ' noimage';
            }
            ?>
">
					<h2 class="entry-title"><a href="<?php 
            the_permalink();
            ?>
" title="<?php 
            printf(esc_attr__('Permalink to %s', 'wpdance'), the_title_attribute('echo=0'));
            ?>
" rel="bookmark"><?php 
            the_title();
            ?>
</a></h2>
					<div class="entry-content">
						<?php 
            the_excerpt_max_charlength(250);
            ?>
					</div><!-- .entry-content -->
					<a href="<?php 
            the_permalink();
            ?>
" class="read-more-btn button"><span><span><?php 
            _e('Read more', 'wpdance');
            ?>
</span></span></a>
				</div>
			</li>
		<?php 
        }
        ?>
		</ul>

		<?php 
        wp_reset_query();
    }
Example #22
0
                        <small style="margin-left: 30px;">
                            <?= ucwords(time_ago($row['dateadded'])) ?>
                            | <?= ucwords(get_user_info_by_id($row['author'], 'fullname')) ?>
                        </small>
                    </td>


                    <td>
                        <?php
                        if ($row['cover_image']) {
                            //if there is a cover image
                            ?>
                            <a href="<?= base_url() . 'uploads/blogs/' . $row['cover_image'] ?>"
                               class="fancybox" title="<?= $row['title'] ?>">
                                <img class="img-circle" width="32px" height="32px"
                                     src="<?= base_url() ?>uploads/blogs/<?= get_thumbnail($row['cover_image']) ?>">
                            </a>


                        <?php

                        } else {
                            ?>
                            <img class="img-rounded" width="32px" height="32px"
                                 src="<?= base_url() ?>uploads/noimage.png">
                        <?php

                        }
                        ?>
                        <a style="padding-left: 10px;" class=""
                           href="<?= base_url() . $this->uri->segment(1) . '/' . $this->uri->segment(2) . '/change_cover/' . encryptValue($row['id']) ?>">change</a>
    $et_featured_term = get_term_by($et_term_by, $featured_cat, 'wpsc_product_category');
    $featured_args = array('post_type' => 'wpsc-product', 'posts_per_page' => $featured_num, 'tax_query' => array(array('taxonomy' => 'wpsc_product_category', 'field' => 'id', 'terms' => (int) $et_featured_term->term_id)));
}
$featured_query = new WP_Query($featured_args);
?>
		<?php 
if ($featured_query->have_posts()) {
    while ($featured_query->have_posts()) {
        $featured_query->the_post();
        ?>
			<div class="slide">
				<?php 
        $width = 380;
        $height = 230;
        $titletext = get_the_title();
        $thumbnail = get_thumbnail($width, $height, '', $titletext, $titletext, false, 'Featured');
        $thumb = $thumbnail["thumb"];
        $featured_link = get_post_meta(get_the_ID(), 'Link', true) ? get_post_meta(get_the_ID(), 'Link', true) : get_permalink();
        ?>

				<div class="featured-image">
					<a href="<?php 
        echo esc_url($featured_link);
        ?>
"><?php 
        print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, '');
        ?>
</a>
					<?php 
        if ('false' == $featured_use_pages) {
            ?>
Example #24
0
    esc_html_e('Recent News', 'Fusion');
    ?>
</h2>

			<ul>
			<?php 
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            ?>
				<?php 
            $thumb = '';
            $width = (int) apply_filters('et_home_blog_image_width', 49);
            $height = (int) apply_filters('et_home_blog_image_height', 49);
            $titletext = get_the_title();
            $thumbnail = get_thumbnail($width, $height, '', $titletext, $titletext, false, 'Blogimage');
            $thumb = $thumbnail["thumb"];
            ?>
				<li class="recent-update clearfix">
				<?php 
            if ('' != $thumb) {
                ?>
					<div class="recent-updates-image">
						<a href="<?php 
                the_permalink();
                ?>
">
							<?php 
                print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, '');
                ?>
							<span class="overlay"></span>
Example #25
0
<?php 
$single_postinfo = et_get_option('explorable_postinfo2');
if (is_page()) {
    $et_ptemplate_settings = maybe_unserialize(get_post_meta(get_the_ID(), 'et_ptemplate_settings', true));
    $fullwidth = isset($et_ptemplate_settings['et_fullwidthpage']) ? (bool) $et_ptemplate_settings['et_fullwidthpage'] : false;
}
$et_fullwidth = isset($fullwidth) && $fullwidth || is_page_template('page-full.php');
$thumb = '';
$width = (int) apply_filters('et_blog_image_width', 640);
if ($et_fullwidth) {
    $width = (int) apply_filters('et_blog_image_width_fullwidth', 960);
}
$height = (int) apply_filters('et_blog_image_height', 280);
$classtext = '';
$titletext = get_the_title();
$thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Indeximage');
$thumb = $thumbnail["thumb"];
$show_thumb = is_page() ? et_get_option('explorable_page_thumbnails', 'false') : et_get_option('explorable_thumbnails', 'on');
?>

<?php 
if ('' != $thumb && 'false' != $show_thumb) {
    ?>
	<div class="post-thumbnail">
		<?php 
    print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext);
    ?>
		<div class="post-description">
			<h1><?php 
    the_title();
    ?>
Example #26
0
			<li class="slide">
		<?php 
        } else {
            ?>
			<div class="slide">
		<?php 
        }
        ?>
				<?php 
        $width = $responsive ? 960 : 958;
        $height = 340;
        $small_width = 95;
        $small_height = 54;
        $titletext = get_the_title();
        $thumbnail = get_thumbnail($width, $height, '', $titletext, $titletext, false, 'Featured');
        $arr[$i]['thumbnail'] = get_thumbnail($small_width, $small_height, '', $titletext, $titletext, false, 'Small');
        $arr[$i]['titletext'] = $titletext;
        $thumb = $thumbnail["thumb"];
        print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, '');
        ?>
				<div class="featured-top-shadow"></div>
				<div class="featured-bottom-shadow"></div>	
				<div class="featured-description">
					<div class="feat_desc">
						<p class="meta-info"><!-- <?php 
        esc_html_e('Posted', 'Aggregate');
        ?>
 <?php 
        esc_html_e('by', 'Aggregate');
        ?>
 --> <?php 
				<?php 
        if (get_option('mycuisine_integration_single_top') != '' && get_option('mycuisine_integrate_singletop_enable') == 'on') {
            echo get_option('mycuisine_integration_single_top');
        }
        ?>

				<?php 
        if (get_option('mycuisine_thumbnails') == 'on') {
            ?>
					<?php 
            $thumb = '';
            $width = 212;
            $height = 213;
            $classtext = 'post-thumb';
            $titletext = get_the_title();
            $thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Entry');
            $thumb = $thumbnail["thumb"];
            ?>

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

    <input type="hidden" name="id" value="<?= $id ?>" class="form-control" id="user_id">


    <div class="form-group">

        <div class="col-sm-9">
            <div class="fileinput fileinput-new" data-provides="fileinput">
                <div class="fileinput-preview thumbnail" data-trigger="fileinput" style="width: 200px; height: 150px;">
                    <?php
                    //if there is an image
                    if (get_about_us_article_info_by_id($id, 'image')) {
                        ?>
                        <img
                            src="<?= base_url() . 'uploads/about_us/' . get_thumbnail(get_about_us_article_info_by_id($id, 'image')) ?>">
                    <?php
                    }
                    ?>

                </div>
                <div>

                    <?php
                    $data = array
                    (
                        'name' => 'userfile',
                        'id' => 'userfile',
                        'value' => set_value('userfile'),
                        'maxlength' => '',
                        'size' => '',
Example #29
0
                ?>
 <?php 
                #the_category(', ')
                ?>
 <!-- | --> <?php 
                #comments_popup_link(esc_html__('0 comments','Chameleon'), esc_html__('1 comment','Chameleon'), '% '.esc_html__('comments','Chameleon'));
                ?>
 <!-- </p> -->
						
						<?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 -->
/**
 * @param array $args
 */
function the_thumbnail($args)
{
    echo get_thumbnail($args);
}