Ejemplo n.º 1
0
            $current_year = $post_year;
            // start new month grouping
            printf('<div class="timeline-module et_extra_other_module year-%1$d" data-year="%1$d" data-month="%2$s" id="%2$s_%1$d" style="border-top-color:%4$s">
		<div class="module-head">
			<h1 class="module-title-month">%3$s</h1>
			<span class="module-filter module-title-year">%1$d</span>
		</div>
		<ul class="posts-list">', esc_attr($current_year), esc_attr($current_month), esc_html($wp_locale->get_month($current_month_number)), esc_attr(extra_global_accent_color()));
        }
        // end conditional group header logic
        // begin post creation
        ?>
	<li>
		<article class="post">
			<?php 
        $thumb = et_extra_get_post_thumb(array('size' => 'extra-image-square-small', 'a_class' => array('post-thumbnail')));
        if ($thumb) {
            echo $thumb;
        }
        ?>
			<div class="post-content">
				<h3><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h3>
				<div class="post-meta">
					<?php 
        extra_the_post_date();
Ejemplo n.º 2
0
            ?>
						<div class="et_extra_other_module related-posts">
							<div class="related-posts-header">
								<h3><?php 
            esc_html_e('Related Posts', 'extra');
            ?>
</h3>
							</div>
							<div class="related-posts-content clearfix">
								<?php 
            while ($related_posts->have_posts()) {
                $related_posts->the_post();
                ?>
								<div class="related-post">
									<div class="featured-image"><?php 
                echo et_extra_get_post_thumb(array('size' => 'extra-image-small', 'a_class' => array('post-thumbnail'), 'post_format_thumb_fallback' => true, 'img_after' => '<span class="et_pb_extra_overlay"></span>'));
                ?>
</div>
									<h4 class="title"><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h4>
									<p class="date"><?php 
                extra_the_post_date();
                ?>
</p>
								</div>
								<?php 
Ejemplo n.º 3
0
                $thumb_src = et_get_post_format_thumb($post_format);
                $img_style = sprintf('background-color:%s', $color);
            } else {
                if ('gallery' == $post_format) {
                    $thumb_src = et_get_gallery_post_format_thumb();
                } else {
                    if (!get_post_thumbnail_id()) {
                        $thumb_src = et_get_post_format_thumb('text', 'icon');
                        $img_style = sprintf('background-color:%s', $color);
                    } else {
                        $img_style = sprintf('background-color:%s', $color);
                    }
                }
            }
            if ($show_thumbnails) {
                echo et_extra_get_post_thumb(array('size' => 'extra-image-square-small', 'a_class' => array('post-thumbnail'), 'thumb_src' => !empty($thumb_src) ? $thumb_src : '', 'img_style' => !empty($img_style) ? $img_style : ''));
            }
            ?>
				<div class="post-content">
					<h3><a href="<?php 
            the_permalink();
            ?>
" data-hover-color="<?php 
            echo esc_attr($color);
            ?>
"><?php 
            the_title();
            ?>
</a></h3>
					<div class="post-meta">
						<p><?php 
Ejemplo n.º 4
0
function et_thumb_as_style_background()
{
    $thumb_src = et_extra_get_post_thumb(array('size' => extra_get_column_thumbnail_size(), 'return' => 'thumb_src'));
    if (!empty($thumb_src)) {
        echo 'style="background-image: url(' . esc_attr($thumb_src) . ');"';
    }
    return;
}
Ejemplo n.º 5
0
    function widget($args, $instance)
    {
        $cache = array();
        if (!$this->is_preview()) {
            $cache = wp_cache_get('widget_recent_posts', 'extra');
        }
        if (!is_array($cache)) {
            $cache = array();
        }
        if (!isset($args['widget_id'])) {
            $args['widget_id'] = $this->id;
        }
        if (isset($cache[$args['widget_id']])) {
            echo $cache[$args['widget_id']];
            return;
        }
        ob_start();
        $title = !empty($instance['title']) ? $instance['title'] : __('Recent Posts', 'extra');
        /** This filter is documented in wp-includes/default-widgets.php */
        $title = apply_filters('widget_title', $title, $instance, $this->id_base);
        $number = !empty($instance['number']) ? absint($instance['number']) : 5;
        if (!$number) {
            $number = 5;
        }
        $show_date = isset($instance['show_date']) ? $instance['show_date'] : false;
        $show_thumb = isset($instance['show_thumb']) ? $instance['show_thumb'] : false;
        $show_categories = isset($instance['show_categories']) ? $instance['show_categories'] : false;
        /**
         * Filter the arguments for the Recent Posts widget.
         *
         * @since 3.4.0
         *
         * @see WP_Query::get_posts()
         *
         * @param array $args An array of arguments used to retrieve the recent posts.
         */
        $r = new WP_Query(apply_filters('widget_posts_args', array('posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true)));
        if ($r->have_posts()) {
            ?>
		<?php 
            echo $args['before_widget'];
            ?>
		<?php 
            if ($title) {
                echo $args['before_title'] . $title . $args['after_title'];
            }
            ?>
		<ul class="widget_list">
		<?php 
            while ($r->have_posts()) {
                $r->the_post();
                ?>
			<li>
				<?php 
                $color = extra_get_post_category_color();
                $post_format = et_get_post_format();
                if ($show_thumb) {
                    if (in_array($post_format, array('video', 'quote', 'link', 'audio', 'map', 'text'))) {
                        $thumb_src = et_get_post_format_thumb($post_format);
                        $img_style = sprintf('background-color:%s', $color);
                    } else {
                        if ('gallery' == $post_format) {
                            $thumb_src = et_get_gallery_post_format_thumb();
                        } else {
                            if (!get_post_thumbnail_id()) {
                                $thumb_src = et_get_post_format_thumb('text', 'icon');
                                $img_style = sprintf('background-color:%s', $color);
                            }
                        }
                    }
                    $thumb_args = array('a_class' => array('widget_list_thumbnail'), 'size' => 'extra-image-square-small', 'thumb_src' => !empty($thumb_src) ? $thumb_src : '', 'img_style' => !empty($img_style) ? $img_style : '');
                    ?>
					<?php 
                    echo et_extra_get_post_thumb($thumb_args);
                    ?>
				<?php 
                }
                ?>
				<div class="post_info">
					<a href="<?php 
                the_permalink();
                ?>
" class="title"><?php 
                get_the_title() ? the_title() : the_ID();
                ?>
</a>
					<?php 
                $meta_args = array('post_date' => $show_date, 'categories' => $show_categories, 'author_link' => false, 'comment_count' => false, 'rating_stars' => false);
                ?>
					<div class="post-meta">
						<?php 
                echo et_extra_display_post_meta($meta_args);
                ?>
					</div>
				</div>
			</li>
		<?php 
            }
            ?>
		<?php 
            wp_reset_postdata();
            ?>
		</ul>
		<?php 
            echo $args['after_widget'];
            // Reset the global $the_post as this query will have stomped on it
            wp_reset_postdata();
        }
        if (!$this->is_preview()) {
            $cache[$args['widget_id']] = ob_get_flush();
            wp_cache_set('et_widget_recent_posts', $cache, 'extra');
        } else {
            ob_end_flush();
        }
    }
Ejemplo n.º 6
0
        }
        ?>
		<article id="post-<?php 
        the_ID();
        ?>
" <?php 
        post_class($carousel_post_class);
        ?>
>
			<?php 
        if (!empty($hover_overlay_icon)) {
            $overlay = '<span class="et_pb_extra_overlay et_pb_inline_icon" data-icon="' . esc_attr(et_pb_process_font_icon($hover_overlay_icon)) . '"></span>';
        } else {
            $overlay = '<span class="et_pb_extra_overlay"></span>';
        }
        echo et_extra_get_post_thumb(array('size' => 'extra-image-small', 'a_class' => array('post-thumbnail'), 'img_after' => $overlay));
        ?>
			<div class='post-content-box'>
				<div class="post-content">
					<h3><a href="<?php 
        the_permalink();
        ?>
"><?php 
        truncate_title(40);
        ?>
</a></h3>
					<?php 
        if ($show_date) {
            ?>
					<div class="post-meta">
						<?php 
Ejemplo n.º 7
0
						<?php 
                $category_classes = extra_get_portfolio_project_category_classes();
                ?>
						<a href="<?php 
                the_permalink();
                ?>
" id="project-<?php 
                the_ID();
                ?>
" <?php 
                post_class($category_classes);
                ?>
>
							<span class="project-content">
								<?php 
                $thumb = et_extra_get_post_thumb(array('size' => 'extra-image-square-medium', 'link_wrapped' => false, 'img_after' => '<span class="et_pb_extra_overlay"></span>'));
                ?>
								<?php 
                if ($thumb) {
                    ?>
								<span class="thumbnail featured-image">
								<?php 
                    echo $thumb;
                    ?>
								</span>
								<?php 
                }
                ?>

							<?php 
                if (!($portfolio_options['hide_title'] && $portfolio_options['hide_categories'])) {
Ejemplo n.º 8
0
        function mega_item_featured_3($item, $args, $posts)
        {
            $output = '<ul class="sub-menu" style="' . esc_attr($this->get_mega_item_border_top($item)) . '">';
            $post_count = 0;
            foreach ($posts->posts as $post) {
                if ($post_count >= 3) {
                    break;
                }
                $thumb = et_extra_get_post_thumb(array('post_id' => $post->ID, 'size' => 'extra-image-small', 'a_class' => array('featured-image')));
                $output .= sprintf('
					<li>
						<h2 class="title">%1$s</h2>
						<div class="featured-post">
							%2$s
							<h2>%3$s</h2>
							<div class="post-meta">
								%4$s
							</div>
						</div>
					</li>', esc_html__('Featured', 'extra'), $thumb, esc_html($post->post_title), et_extra_display_post_meta(array('post_id' => $post->ID, 'comment_count' => false, 'author_link' => false)));
                $post_count++;
            }
            $output .= '</ul>';
            return $output;
        }