/** * Popular Posts * * To override this shortcode in a child theme, copy this file to your child theme's * theme_config/extensions/shortcodes/shortcodes/ folder. * * Optional arguments: * items: * title: * image_width: * image_height: * image_class: */ function tfuse_popular_posts($atts, $content = null) { extract(shortcode_atts(array('items' => 5, 'title' => 'Popular Posts', 'image_width' => 75, 'image_height' => 75, 'image_class' => 'thumbnail'), $atts)); $return_html = !empty($title) ? '<h2>' . $title . '</h2>' : ''; $latest_posts = tfuse_shortcode_posts(array('sort' => 'popular', 'items' => $items, 'image_post' => true, 'image_width' => $image_width, 'image_height' => $image_height, 'image_class' => $image_class, 'date_post' => false)); $return_html .= ' <div class="widget_popular_posts"> <ul>'; foreach ($latest_posts as $post_val) { $return_html .= '<li>'; $return_html .= '<a href="' . $post_val['post_link'] . '" class="post-title">' . $post_val['post_title'] . '</a>'; $return_html .= ' <div class="post-meta"><em> ' . __('by ', 'tfuse') . '<a href="' . $post_val['post_author_link'] . '" class="author">' . $post_val['post_author_name'] . '</a> <span class="separator">|</span>' . $post_val['post_comnt_numb_link'] . '</em> </div>'; $return_html .= ' <div class="extras"> ' . $post_val['post_img'] . ' ' . $post_val['post_excerpt'] . ' </div> <a href="' . $post_val['post_link'] . '" class="link-more">' . __('Read more', 'tfuse') . '</a>'; $return_html .= '</li>'; } $return_html .= ' </ul> </div> '; return $return_html; }
/** * Popular Posts * * To override this shortcode in a child theme, copy this file to your child theme's * theme_config/extensions/shortcodes/shortcodes/ folder. * * Optional arguments: * items: * title: * image_width: * image_height: * image_class: */ function tfuse_popular_posts($atts, $content = null) { remove_filter('excerpt_length', 'tfuse_custom_excerpt_length'); add_filter('excerpt_length', 'tfuse_custom_excerpt_length_short', 99); extract(shortcode_atts(array('items' => 5, 'title' => 'Popular Posts', 'image_width' => 70, 'image_height' => 70, 'image_class' => 'thumb'), $atts)); $return_html = ''; $latest_posts = tfuse_shortcode_posts(array('sort' => 'popular', 'items' => $items, 'image_post' => true, 'image_width' => $image_width, 'image_height' => $image_height, 'image_class' => $image_class, 'date_post' => true)); $return_html .= '<div class="widget-container widget_postlist widget_recent_posts">'; if (!empty($title)) { $return_html .= '<h3 class="widget-title">' . tfuse_qtranslate($title) . '</h3>'; } $return_html .= '<ul>'; foreach ($latest_posts as $post_val) { $return_html .= '<li class="clearfix"> <a href="' . $post_val['post_link'] . '" class="post-title">' . $post_val['post_title'] . '</a> <div class="post-meta"> <span class="post-date">' . $post_val['post_date_post'] . '</span> | ' . $post_val['post_comnt_numb_link'] . ' </div> <div class="extras"><a href="' . $post_val['post_link'] . '">' . $post_val['post_img'] . '</a> ' . $post_val['post_excerpt'] . '</div> <a href="' . $post_val['post_link'] . '" class="link-more">' . __('Read more', 'tfuse') . '</a> </li>'; } $return_html .= '</ul> </div>'; return $return_html; }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts', 'tfuse') : $instance['title'], $instance, $this->id_base); $number = esc_attr($instance['number']); $b = $instance['b'] = empty($instance['b']) ? '' : $instance['b']; $class = $b ? 'widget-boxed' : ''; if ($number > 0) { } else { $number = 8; } ?> <div class="widget widget_recent_entries <?php echo $class; ?> "> <h3 class="widget-title"><?php echo tfuse_qtranslate($title); ?> </h3> <ul class="side-postlist"> <?php $pop_posts = tfuse_shortcode_posts(array('sort' => 'recent', 'items' => $number, 'image_post' => true, 'image_width' => 62, 'image_height' => 62, 'image_class' => 'post-thumbnail')); foreach ($pop_posts as $post_val) { ?> <li> <a href="<?php echo $post_val['post_link']; ?> "><?php echo $post_val['post_img']; ?> </a> <a href="<?php echo $post_val['post_link']; ?> " class="post-title"><?php echo $post_val['post_title']; ?> </a> <span class="comments-link"><a href="<?php echo $post_val['post_link']; ?> #comments"><?php echo tfuse_get_comments(false, $post_val['post_id']); ?> </a></span> </li> <?php } ?> </ul> </div> <?php }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base); $number = esc_attr($instance['number']); if ($number > 0) { } else { $number = 6; } $before_widget = '<div class="widget widget-freshpost">'; $after_widget = '</div>'; echo $before_widget; ?> <?php if (!empty($title)) { ?> <h3 class="widget-title"><?php echo tfuse_qtranslate($title); ?> </h3> <?php } ?> <ul class="side-postlist"> <?php $recent_posts = tfuse_shortcode_posts(array('sort' => 'recent', 'items' => $number, 'image_post' => false, 'date_post' => false)); foreach ($recent_posts as $post_val) { ?> <li><a href="<?php echo $post_val['post_link']; ?> "><span><?php echo $post_val['post_title']; ?> </span></a></li> <?php } ?> </ul> <?php if (isset($instance['enable_rss']) && $instance['enable_rss']) { ?> <a href="<?php echo tfuse_options('feedburner_url', '#'); ?> " class="btn btn-orange btn-freshpost"><span><?php _e('subscribe to rss feed', 'tfuse'); ?> </span></a> <?php } ?> <?php echo $after_widget; }
/** * Doctors * * To override this shortcode in a child theme, copy this file to your child theme's * theme_config/extensions/shortcodes/shortcodes/ folder. * * Optional arguments: * items: * title: * image_width: * image_height: * image_class: */ function tfuse_spec_doctor($atts, $content = null) { extract(shortcode_atts(array('items' => 4, 'title' => '', 'image_width' => 115, 'image_height' => 152, 'image_class' => 'thumbnail', 'specialites' => ''), $atts)); $return_html = !empty($title) ? '<h2>' . $title . '</h2>' : ''; $latest_posts = tfuse_shortcode_posts(array('sort' => 'recent', 'items' => $items, 'image_post' => true, 'image_width' => $image_width, 'image_height' => $image_height, 'image_class' => $image_class, 'date_post' => false, 'post_type' => 'doctors', 'specialites' => $specialites)); foreach ($latest_posts as $post_val) { $return_html .= $post_val['post_img'] . ' <h3 class="title_pink text_italic">' . $post_val['post_title'] . '</h3> ' . $post_val['post_excerpt'] . ' <div class="divider_space_thin"></div>'; } return $return_html; }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Discussed Posts', 'tfuse') : $instance['title'], $instance, $this->id_base); $number = esc_attr($instance['number']); if ($number > 0) { } else { $number = 6; } $before_widget = '<div class="widget widget-most-comment">'; $after_widget = '</div>'; echo $before_widget; ?> <?php if (!empty($title)) { ?> <h3 class="widget-title"><?php echo tfuse_qtranslate($title); ?> </h3> <?php } ?> <ul class="side-postlist"> <?php $discussed_posts = tfuse_shortcode_posts(array('sort' => 'commented', 'items' => $number, 'image_post' => false, 'date_post' => false)); foreach ($discussed_posts as $post_val) { ?> <li> <a href="<?php echo $post_val['post_link']; ?> " ><div class="icon"><strong><?php echo $post_val['post_comnt_numb']; ?> </strong></div><span><?php echo $post_val['post_title']; ?> </span></a> </li> <?php } ?> </ul> <?php echo $after_widget; }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts', 'tfuse') : $instance['title'], $instance, $this->id_base); $number = esc_attr($instance['number']); if ($number > 0) { } else { $number = 8; } ?> <div class="widget-container widget_recent_posts"> <h3 class="widget-title"><?php echo tfuse_qtranslate($title); ?> </h3> <ul> <?php $pop_posts = tfuse_shortcode_posts(array('sort' => 'recent', 'items' => $number, 'image_post' => false, 'date_post' => false)); foreach ($pop_posts as $post_val) { ?> <li class="<?php echo $post_val['post_class']; ?> "> <a class="post-title" href="<?php echo $post_val['post_link']; ?> "><?php echo $post_val['post_title']; ?> </a> </li> <?php } ?> </ul> </div> <?php }
/** * Popular Posts * * To override this shortcode in a child theme, copy this file to your child theme's * theme_config/extensions/shortcodes/shortcodes/ folder. * * Optional arguments: * items: * title: * image_width: * image_height: * image_class: */ function tfuse_popular_posts($atts, $content = null) { $return_html = ''; extract(shortcode_atts(array('items' => 5, 'title' => 'Popular Posts', 'image_width' => 62, 'image_height' => 62, 'image_class' => 'post-thumbnail'), $atts)); $latest_posts = tfuse_shortcode_posts(array('sort' => 'popular', 'items' => $items, 'image_post' => true, 'image_width' => $image_width, 'image_height' => $image_height, 'image_class' => $image_class)); $return_html .= ' <div class="widget widget_recent_entries">'; $return_html .= !empty($title) ? '<h3 class="widget-title">' . $title . '</h3>' : ''; $return_html .= '<ul class="side-postlist">'; foreach ($latest_posts as $post_val) { $return_html .= '<li>'; $return_html .= $post_val['post_img']; $return_html .= '<a href="' . $post_val['post_link'] . '" class="post-title">' . $post_val['post_title'] . '</a>'; $return_html .= '<span class="comments-link"><a href="' . $post_val['post_link'] . '#comments" >' . strtolower(strip_tags($post_val['post_comnt_numb_link'])) . '</a></span>'; $return_html .= '</li>'; } $return_html .= '</ul></div> '; return $return_html; }
/** * MG Latest News * * To override this shortcode in a child theme, copy this file to your child theme's * theme_config/extensions/shortcodes/shortcodes/ folder. * */ function tfuse_mglatest_post($atts, $content = null) { extract(shortcode_atts(array('items' => 3, 'title' => 'Latest News'), $atts)); $return_html = ''; $latest_posts = tfuse_shortcode_posts(array('sort' => 'recent', 'items' => $items, 'image_post' => false, 'date_post' => true)); $return_html .= '<div class="widget-container widget_recent_entries">'; $return_html .= !empty($title) ? '<h3 class="widget-title">' . tfuse_qtranslate($title) . '</h3>' : ''; $return_html .= '<ul>'; foreach ($latest_posts as $post_val) { $return_html .= '<li class="clearfix"> <a href="' . $post_val['post_link'] . '" class="link-name">' . $post_val['post_title'] . '</a> <div class="post-meta"> <span class="post-date">' . __('posted on ', 'tfuse') . $post_val['post_date_post'] . ',</span> <a href="' . $post_val['post_link'] . '#comments">' . strtolower(strip_tags($post_val['post_comnt_numb_link'])) . '</a> </div> </li>'; } $return_html .= '</ul></div>'; return $return_html; }
function tfuse_recent_posts($atts, $content = null) { $return_html = ''; extract(shortcode_atts(array('items' => 5), $atts)); $latest_posts = tfuse_shortcode_posts(array('sort' => 'recent', 'items' => $items, 'image_post' => false, 'date_format' => 'F jS,Y', 'date_post' => true)); $return_html .= ' <div class="widget recent-posts"> <ul>'; foreach ($latest_posts as $post_val) { $return_html .= '<li>'; $return_html .= ' <a href="' . $post_val['post_link'] . '" class="entry-title">' . $post_val['post_title'] . '</a>'; $return_html .= '<div class="entry-meta"> <time class="entry-date" datetime="">' . $post_val['post_date_post'] . '</time> <a href="' . $post_val['post_link'] . '#comments" class="comments-link"><span>' . tfuse_get_comments(true, $post_val['post_id']) . '</span></a> </div>'; $return_html .= '</li>'; } $return_html .= '</ul></div> '; return $return_html; }
function tfuse_tabs_posts($atts) { extract(shortcode_atts(array('items' => ''), $atts)); $popular_posts = tfuse_shortcode_posts(array('sort' => 'popular', 'items' => $items, 'image_post' => true, 'image_width' => 50, 'image_height' => 50, 'image_class' => 'thumb', 'date_format' => 'M j, Y', 'date_post' => true)); $latest_posts = tfuse_shortcode_posts(array('sort' => 'commented', 'items' => $items, 'image_post' => true, 'image_width' => 50, 'image_height' => 50, 'image_class' => 'thumb', 'date_format' => 'M j, Y', 'date_post' => true)); $return_html = ''; $return_html .= '<div class="tabs_framed no-padding"> <div class="inner"> <ul class="nav nav-tabs clearfix active_bookmark1"> <li class="active"><a href="#tab_cont_1_1" data-toggle="tab">' . __('Recent Posts', 'tfuse') . '</a></li> <li><a href="#tab_cont_1_2" data-toggle="tab">' . __('Most Commented', 'tfuse') . '</a></li> </ul> <div class="tab-content clearfix"> <div id="tab_cont_1_1" class="tab-pane fade in active"> <ul class="post_list recent_posts">'; foreach ($popular_posts as $post_val) { $return_html .= '<li class="clearfix">'; $return_html .= '<a href="' . $post_val['post_link'] . '" >' . $post_val['post_img'] . '</a>' . ' <a href="' . $post_val['post_link'] . '" >' . $post_val['post_title'] . '</a>'; $return_html .= '<div class="date">' . $post_val['post_date_post'] . '</div>'; $return_html .= '</li>'; } $return_html .= '</ul> </div> <div id="tab_cont_1_2" class="tab-pane fade"> <ul class="post_list popular_posts">'; foreach ($latest_posts as $post_val) { $return_html .= '<li class="clearfix">'; $return_html .= '<a href="' . $post_val['post_link'] . '" >' . $post_val['post_img'] . '</a>'; $return_html .= '<a href="' . $post_val['post_link'] . '" > ' . $post_val['post_title'] . '</a>'; $return_html .= '<div class="date">' . $post_val['post_date_post'] . '</div>'; $return_html .= '</li>'; } $return_html .= '</ul> </div> </div> </div> </div>'; return $return_html; }
function widget($args, $instance) { extract($args); if (isset($instance['number'])) { $number = esc_attr($instance['number']); } else { $number = 5; } ?> <div class="tf_sidebar_tabs tabs_framed"> <ul class="tabs"> <li><a href="#tf_tabs_1"><?php _e('Recent Posts', 'tfuse'); ?> </a></li> <li><a href="#tf_tabs_2"><?php _e('Most Commented', 'tfuse'); ?> </a></li> </ul> <div id="tf_tabs_1" class="tabcontent"> <ul class="post_list recent_posts"> <?php $rec_posts = tfuse_shortcode_posts(array('sort' => 'recent', 'items' => $number)); foreach ($rec_posts as $recpost_val) { ?> <li> <a href="<?php echo $recpost_val['post_link']; ?> "><?php echo $recpost_val['post_img']; ?> </a> <a href="<?php echo $recpost_val['post_link']; ?> "><?php echo $recpost_val['post_title']; ?> </a> <div class="date"><?php echo $recpost_val['post_date_post']; ?> </div> </li> <?php } ?> </ul> </div> <div id="tf_tabs_2" class="tabcontent"> <ul class="post_list popular_posts"> <?php $pop_posts = tfuse_shortcode_posts(array('sort' => 'commented', 'items' => $number)); foreach ($pop_posts as $post_val) { ?> <li> <a href="<?php echo $post_val['post_link']; ?> "><?php echo $post_val['post_img']; ?> </a> <a href="<?php echo $post_val['post_link']; ?> "><?php echo $post_val['post_title']; ?> </a> <div class="date"><?php echo $post_val['post_date_post']; ?> </div> </li> <?php } ?> </ul> </div> </div> <?php }