function evolve_posts_slider() { ?> <div id="slide_holder"> <div class="slide-container"> <ul id="slides"> <?php $number_items = evolve_get_option('evl_posts_number', '5'); $slider_content = evolve_get_option('evl_posts_slider_content', 'recent'); $slider_content_category = ''; $slider_content_category = evolve_get_option('evl_posts_slider_id', ''); //make array categories into string with commas. if (is_array($slider_content_category)) { $slider_content_category = implode(",", $slider_content_category); } if ($slider_content == "category" && !empty($slider_content_category)) { $slider_content_ID = $slider_content_category; } else { $slider_content_ID = ''; } $args = array('cat' => $slider_content_ID, 'showposts' => $number_items, 'ignore_sticky_posts' => 1); query_posts($args); if (have_posts()) { $featured = new WP_Query($args); while ($featured->have_posts()) { $featured->the_post(); ?> <li class="slide"> <?php if (has_post_thumbnail()) { echo '<div class="featured-thumbnail"><a href="'; the_permalink(); echo '">'; the_post_thumbnail('slider-thumbnail'); echo '</a></div>'; } else { $image = evolve_get_first_image(); if ($image) { echo '<div class="featured-thumbnail"><a href="'; the_permalink(); echo '"><img src="' . $image . '" alt="'; the_title(); echo '" /></a></div>'; } } ?> <h2 class="featured-title"> <a class="title" href="<?php the_permalink(); ?> "> <?php $title = the_title('', '', false); $length = evolve_get_option('evl_posts_slider_title_length', 40); echo evolve_truncate($title, $length, '...'); ?> </a> </h2> <p><?php $excerpt_length = evolve_get_option('evl_posts_slider_excerpt_length', 40); echo evolve_excerpt_max_charlength($excerpt_length); ?> </p> <a class="button post-more" href="<?php the_permalink(); ?> "><?php _e('Read more', 'evolve'); ?> </a> </li> <?php } ?> <?php } else { ?> <li><?php _e('<h2 style="color:#fff;">Oops, no posts to display! Please check your post slider Category (ID) settings</h2>', 'evolve'); ?> </li> <?php } ?> <?php wp_reset_query(); ?> </ul> </div> </div> <?php }
<?php } else { ?> <h1 class="entry-title"> <a href="<?php the_permalink(); ?> " rel="bookmark" title="Permanent Link to <?php the_title(); ?> "> <?php if (get_the_title()) { $title = the_title('', '', false); echo evolve_truncate($title, $evolve_posts_excerpt_title_length, '...'); } ?> </a> </h1> <?php if ($evolve_edit_post == "1") { ?> <?php if (current_user_can('edit_post', $post->ID)) { ?> <?php edit_post_link(__('EDIT', 'evolve'), '<span class="edit-post edit-attach">', '</span>'); ?> <?php }
<?php } else { ?> <h1 class="entry-title"><a href="<?php the_permalink(); ?> " rel="bookmark" title="Permanent Link to <?php the_title(); ?> "> <?php if (get_the_title()) { $title = the_title('', '', false); echo evolve_truncate($title, 40, '...'); } ?> </a> </h1> <?php if (current_user_can('edit_post', $post->ID)) { ?> <?php edit_post_link(__('EDIT', 'evolve'), '<span class="edit-post edit-attach">', '</span>'); ?> <?php } ?> <?php
function widget($args, $instance) { global $data, $post; extract($args); $posts = $instance['posts']; $comments = $instance['comments']; $tags_count = $instance['tags']; $show_popular_posts = isset($instance['show_popular_posts']) ? 'true' : 'false'; $show_recent_posts = isset($instance['show_recent_posts']) ? 'true' : 'false'; $show_comments = isset($instance['show_comments']) ? 'true' : 'false'; $show_tags = isset($instance['show_tags']) ? 'true' : 'false'; $orderby = $instance['orderby']; if (!$orderby) { $orderby = 'Highest Comments'; } echo $before_widget; ?> <div class="tab-holder"> <div class="tabs-wrapper"> <ul id="tabs" class="tabset tabs"> <?php if ($show_popular_posts == 'true') { ?> <li><a href="#tab-popular"><?php _e('Popular', 'evolve'); ?> </a></li> <?php } ?> <?php if ($show_recent_posts == 'true') { ?> <li><a href="#tab-recent"><?php _e('Recent', 'evolve'); ?> </a></li> <?php } ?> <?php if ($show_comments == 'true') { ?> <li><a href="#tab-comments"><?php _e('Comments', 'evolve'); ?> </a></li> <?php } ?> </ul> <div class="tab-box tabs-container"> <?php if ($show_popular_posts == 'true') { ?> <div id="tab-popular" class="tab tab_content" style="display: none;"> <?php if ($orderby == 'Highest Comments') { $order_string = '&orderby=comment_count'; } else { $order_string = '&meta_key=evolve_post_views_count&orderby=meta_value_num'; } $popular_posts = new WP_Query('showposts=' . $posts . $order_string . '&order=DESC'); if ($popular_posts->have_posts()) { ?> <ul class="news-list"> <?php while ($popular_posts->have_posts()) { $popular_posts->the_post(); ?> <li> <?php if (has_post_thumbnail()) { ?> <div class="image"> <a href="<?php the_permalink(); ?> "> <?php the_post_thumbnail('tabs-img'); ?> </a> </div> <?php } ?> <div class="post-holder"> <a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a> <div class="meta"> <?php the_time(get_option('date_format')); ?> </div> </div> </li> <?php } ?> </ul> <?php } ?> </div> <?php } ?> <?php if ($show_recent_posts == 'true') { ?> <div id="tab-recent" class="tab tab_content" style="display: none;"> <?php $recent_posts = new WP_Query('showposts=' . $tags_count); if ($recent_posts->have_posts()) { ?> <ul class="news-list"> <?php while ($recent_posts->have_posts()) { $recent_posts->the_post(); ?> <li> <?php if (has_post_thumbnail()) { ?> <div class="image"> <a href="<?php the_permalink(); ?> "> <?php the_post_thumbnail('tabs-img'); ?> </a> </div> <?php } ?> <div class="post-holder"> <a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a> <div class="meta"> <?php the_time(get_option('date_format')); ?> </div> </div> </li> <?php } ?> </ul> <?php } ?> </div> <?php } ?> <?php if ($show_comments == 'true') { ?> <div id="tab-comments" class="tab tab_content" style="display: none;"> <ul class="news-list"> <?php $number = $instance['comments']; global $wpdb; $recent_comments = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_author_email, comment_date_gmt, comment_approved, comment_type, comment_author_url, SUBSTRING(comment_content,1,110) AS com_excerpt FROM {$wpdb->comments} LEFT OUTER JOIN {$wpdb->posts} ON ({$wpdb->comments}.comment_post_ID = {$wpdb->posts}.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT {$number}"; $the_comments = $wpdb->get_results($recent_comments); foreach ($the_comments as $comment) { ?> <li> <div class="image"> <?php echo get_avatar($comment, '50'); ?> </div> <div class="post-holder"> <a class="comment-text-side" href="<?php echo get_permalink($comment->ID); ?> #comment-<?php echo $comment->comment_ID; ?> " title="<?php echo strip_tags($comment->comment_author); ?> on <?php echo $comment->post_title; ?> "><?php echo strip_tags($comment->comment_author); _e('says', 'evolve'); ?> </a> <div class="meta"> <?php echo evolve_truncate(strip_tags($comment->com_excerpt), 70); ?> </div> </div> </li> <?php } ?> </ul> </div> <?php } ?> </div> </div> </div> <?php echo $after_widget; }
</a></span>'; } } ?> <?php } ?> <?php $postexcerpt = get_the_content(); $postexcerpt = apply_filters('the_content', $postexcerpt); $postexcerpt = str_replace(']]>', ']]>', $postexcerpt); $postexcerpt = strip_tags($postexcerpt); $postexcerpt = strip_shortcodes($postexcerpt); echo evolve_truncate($postexcerpt, 350, ' [...]'); ?> <div class="entry-meta entry-footer"> <div class="read-more btn btn-right icon-arrow-right"> <a href="<?php the_permalink(); ?> "><?php _e('READ MORE', 'evolve'); ?> </a> </div>
function evolve_posts_slider() { ?> <div id="slide_holder"> <div class="slide-container"> <ul id="slides"> <?php $number_items = evolve_get_option('evl_posts_number', '5'); $slider_content = evolve_get_option('evl_posts_slider_content', 'recent'); $slider_content_category = ''; $slider_content_category = evolve_get_option('evl_posts_slider_id', ''); if ($slider_content == "category" && !empty($slider_content_category)) { $slider_content_ID = $slider_content_category; } else { $slider_content_ID = ''; } $args = array('cat' => $slider_content_ID, 'showposts' => $number_items, 'ignore_sticky_posts' => 1); query_posts($args); ?> <?php if (have_posts()) { $featured = new WP_Query($args); while ($featured->have_posts()) { $featured->the_post(); ?> <li class="slide"> <?php if (has_post_thumbnail()) { echo '<div class="featured-thumbnail"><a href="'; the_permalink(); echo '">'; the_post_thumbnail('slider-thumbnail'); echo '</a></div>'; } else { $image = evolve_get_first_image(); if ($image) { echo '<div class="featured-thumbnail"><a href="'; the_permalink(); echo '"><img src="' . $image . '" alt="'; the_title(); echo '" /></a></div>'; } } ?> <h2 class="featured-title"> <a class="title" href="<?php the_permalink(); ?> "> <?php $title = the_title('', '', false); echo evolve_truncate($title, 40, '...'); ?> </a> </h2> <p> <?php $postexcerpt = get_the_content(); $postexcerpt = apply_filters('the_content', $postexcerpt); $postexcerpt = str_replace(']]>', ']]>', $postexcerpt); $postexcerpt = strip_tags($postexcerpt); $postexcerpt = strip_shortcodes($postexcerpt); echo evolve_truncate($postexcerpt, 180, ' [...]'); ?> </p> <a class="post-more" href="<?php the_permalink(); ?> "><?php _e('Read more', 'evolve'); ?> </a> </li> <?php } ?> <?php } else { ?> <li> <?php _e('<h2 style="color:#fff;">Oops, no posts to display! Please check your post slider Category (ID) settings</h2>', 'evolve'); ?> </li> <?php } ?> <?php wp_reset_query(); ?> </ul> </div> </div> <?php }