?> <?php the_author_posts_link(); ?> </li> <li><a href="#"><?php the_time('D F Y'); ?> </a></li> <li><?php the_category(', '); ?> </li> <li><?php comments_popup_link(__('0 Comment ', 'element'), __('1 Comment', 'element'), __(' % Comments', 'element')); ?> </li> </ul> <p><?php echo do_shortcode(element_excerpt($limit = 40)); ?> </p> <a href="<?php the_permalink(); ?> "><?php _e('Details', 'element'); ?> <i class="fa fa-angle-right"></i></a> </div> </div>
function shortcode_blog($atts, $content = null) { $atts = shortcode_atts(array('order' => '8', 'id' => '', 'title' => '', 'cat' => ''), $atts); if ($atts['cat'] != '' and $atts['cat'] != 'all') { $args = array('post_type' => 'post', 'posts_per_page' => $atts['order'], 'category_name' => $atts['cat']); } else { $args = array('post_type' => 'post', 'posts_per_page' => $atts['order']); } $blog = new WP_Query($args); ob_start(); ?> <div class="blog-box"> <?php if ($blog->have_posts()) { ?> <?php $i = 1; while ($blog->have_posts()) { $blog->the_post(); ?> <?php if ($i % 3 == 1 or $i == 1) { ?> <div class="row"> <?php } ?> <div class="col-md-4"> <div class="blog-post"> <div class="blog-gal"> <?php if (has_post_thumbnail()) { $img = element_thumbnail_url(''); $img_url = bfi_thumb($img, array('width' => 370, 'height' => 280)); } else { $img_url = 'http://placehold.it/370x280'; } ?> <img src="<?php echo esc_attr($img_url); ?> " alt="<?php the_title(); ?> "> <div class="blog-hover"> <a class="zoom" href="<?php echo esc_attr($img_url); ?> "><i class="fa fa-search"></i></a> </div> </div> <div class="blog-content"> <h2><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <ul class="post-tags"> <li><?php _e('by', 'element'); ?> <?php the_author_posts_link(); ?> </li> <li><a href="#"><?php the_time('d F Y'); ?> </a></li> <li><?php the_category(', '); ?> </li> <li><span class="comment-number"><i class="fa fa-comment-o"></i> <?php comments_popup_link(__(' 0', 'element'), __(' 1 ', 'element'), __(' % ', 'element')); ?> </span></li> </ul> <p><?php echo do_shortcode(element_excerpt($limit = 20)); ?> </p> </div> </div> </div> <?php if ($i % 3 == 0 or $i == $blog->post_count) { ?> </div> <?php } ?> <?php $i++; } ?> <?php } else { ?> <div class="not-found"> <h1><?php _e('Nothing Found Here!', 'element'); ?> </h1> <h3><?php _e('Search with other string:', 'element'); ?> </h3> <div class="search-form"> <?php get_search_form(); ?> </div> </div> <?php } ?> </div> <?php return ob_get_clean(); }