function widget($args, $instance) { extract($args); $uniq = rand(1, 100); $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base); $posts = isset($instance['posts']) ? $instance['posts'] : array(); $b = $instance['b'] = empty($instance['b']) ? '' : $instance['b']; $class = $b ? 'widget-boxed' : ''; $before_widget = '<div class="widget widget_text ' . $class . '">'; $after_widget = '</div>'; $before_title = '<h3 class="widget-title">'; $after_title = '</h3>'; $tfuse_title = !empty($title) ? $before_title . tfuse_qtranslate($title) . $after_title : ''; if (!empty($posts)) { echo $before_widget; echo $tfuse_title; echo ' <div class="textwidget"> <div class="portfolio"> <ul class="portfolio-list">'; foreach ($posts as $key => $post) { $image = get_the_post_thumbnail($key, 'gallery-widget-thumb'); $image_src = wp_get_attachment_url(get_post_thumbnail_id($key, 'post-thumbnails')); if (!empty($image)) { echo '<li> <a data-rel="prettyPhoto[gal_1]" title="' . get_the_title($key) . '" href="' . $image_src . '">' . $image . '</a> </li>'; } } echo ' </ul></div> </div>'; echo $after_widget; } }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Twitter', 'tfuse') : $instance['title'], $instance, $this->id_base); $username = apply_filters('widget_items', $instance['username'], $instance, $this->id_base); $items = apply_filters('widget_items', $instance['items'], $instance, $this->id_base); $return_html = ''; if (!empty($username)) { $tweets = tfuse_get_tweets($username, $items); $before_widget = '<div class="widget widget_twitter">'; $after_widget = '</div>'; $return_html .= $before_widget; if (!empty($title)) { $return_html .= '<h3 class="widget-title">' . tfuse_qtranslate($title) . '</h3>'; } $return_html .= '<div class="tweet_list">'; foreach ($tweets as $tweet) { $return_html .= '<div class="tweet_item clearfix">'; $return_html .= '<div class="tweet_image"><img src="' . $tweet->user->profile_image_url . '" width="58" height="58" alt="" /></div>'; if (isset($tweet->text)) { $return_html .= '<div class="tweet_text">' . $tweet->text; } if (!empty($tweet->created_at)) { $return_html .= '<br><span class="tweet_time">' . ucfirst($tweet->created_at) . '</span>'; } if (isset($tweet->text)) { $return_html .= '</div>'; } $return_html .= '</div>'; } $return_html .= '</div>' . $after_widget; } echo $return_html; }
function widget($args, $instance) { extract($args); $instance['title'] = apply_filters('widget_title', $instance['title'], $instance, $this->id_base); $before_widget = '<div class="widget widget-container widget_login">'; $after_widget = '</div>'; $before_title = '<h3 class="widget-title">'; $after_title = '</h3>'; $return_html = ''; if (!is_user_logged_in()) { $return_html .= $before_widget; if (!empty($instance['title'])) { $return_html .= $before_title . tfuse_qtranslate($instance['title']) . $after_title; } $return_html .= '<form action="' . home_url() . '/wp-login.php" method="post" name="loginform" id="loginform" class="loginform"> <p><label>' . __('Username', 'tfuse') . '</label><br /><input name="log" id="user_login" class="input" value="" size="20" tabindex="10" type="text"></p> <p><label>' . __('Password', 'tfuse') . '</label><br /><input name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20" type="password"></p> <div class="forgetmenot input_styled checklist"> <input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" checked /> <label for="rememberme">' . __('Remember Me', 'tfuse') . '</label> </div> <p class="forget_password"><a href="' . home_url() . '/wp-login.php?action=lostpassword">' . __('Forgot Password?', 'tfuse') . '</a></p> <p class="submit"> <input id="submit" type="submit" name="wp-submit" id="wp-submit" class="btn-submit" value="' . __('Login', 'tfuse') . '" tabindex="100" /> <input type="hidden" name="redirect_to" value="' . home_url() . '/wp-admin/" /> <input type="hidden" name="testcookie" value="1" /> </p> </form>'; } $return_html .= $after_widget; echo $return_html; }
function widget($args, $instance) { extract($args); $flickr_id = esc_attr($instance['flickr_id']); $number = esc_attr($instance['number']); $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base); $before_widget = '<div class="widget flickr flickr_widget">'; $after_widget = '<div class="clear"></div></div>'; $before_title = '<h3 class="widget-title">'; $after_title = '</h3>'; echo $before_widget; $title = tfuse_qtranslate($title); if (!empty($title)) { echo $before_title . $title . $after_title; } ?> <script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?count=<?php echo $number; ?> &display=random&size=s&layout=x&source=user&user=<?php echo $flickr_id; ?> "></script> <?php echo $after_widget; }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Pages', 'tfuse') : $instance['title'], $instance, $this->id_base); $sortby = empty($instance['sortby']) ? 'menu_order' : $instance['sortby']; $exclude = empty($instance['exclude']) ? '' : $instance['exclude']; $b = $instance['b'] = empty($instance['b']) ? '' : $instance['b']; $class = $b ? 'widget-boxed' : ''; $out = wp_list_pages(apply_filters('widget_pages_args', array('title_li' => '', 'echo' => 0, 'sort_column' => $sortby, 'exclude' => $exclude, 'link_before' => '<span>', 'link_after' => '</span>'))); if (!empty($out)) { echo '<div class="widget widget_pages ' . $class . '">'; $title = tfuse_qtranslate($title); if ($title) { echo '<h3 class="widget-title">' . $title . '</h3>'; } ?> <ul> <?php echo $out; ?> </ul> <?php echo '</div>'; } }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base); $before_widget = '<div class="widget-container widget_contact">'; $after_widget = '</div>'; $before_title = '<h3 class="widget-title">'; $after_title = '</h3>'; $tfuse_title = !empty($title) ? $before_title . tfuse_qtranslate($title) . $after_title : ''; echo $before_widget; // echo widgets title echo $tfuse_title; echo '<div class="inner">'; if ($instance['phone'] != '') { echo '<div class="contact-phone"> <label>' . __('by phone:', 'tfuse') . ' </label>' . tfuse_qtranslate($instance['phone']) . ' </div>'; } if ($instance['email'] != '') { echo '<div class="contact-mail"> <label>' . __('by email:', 'tfuse') . '</label> ' . tfuse_qtranslate($instance['email']) . ' </div>'; } if ($instance['adress'] != '') { echo '<div class="contact-address"> <label>' . __('by address:', 'tfuse') . '</label> ' . tfuse_qtranslate($instance['adress']) . ' </div>'; } echo '</div>'; echo $after_widget; }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base); $text = apply_filters('widget_text', $instance['text'], $instance); $b = $instance['b'] = empty($instance['b']) ? '' : $instance['b']; $class = $b ? 'widget-boxed' : ''; $tf_class = @$instance['nopadding'] ? '' : 'class="widget widget_text ' . $class . '"'; $before_widget = '<div ' . $tf_class . '>'; $after_widget = '</div>'; $before_title = '<h3 class="widget-title">'; $after_title = '</h3>'; echo $before_widget; $title = tfuse_qtranslate($title); if (!empty($title)) { ?> <?php echo $before_title . $title . $after_title; } ?> <div class="textwidget"><?php echo $instance['filter'] ? wpautop($text) : $text; ?> </div> <?php echo $after_widget; }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base); $before_widget = '<div class="widget widget-search">'; $after_widget = '</div>'; echo $before_widget; ?> <?php if (!empty($title)) { ?> <h3 class="widget-title"><?php echo tfuse_qtranslate($title); ?> </h3> <?php } ?> <form method="get" id="searchform" action="<?php echo home_url('/'); ?> "> <input name="s" id="s" type="text" class="inputtext" placeholder="<?php echo tfuse_options('search_box_text'); ?> " name="search" value=""> <button type="submit" class="btn btn-search"><span class="tficon-row"></span></button> </form> <?php echo $after_widget; }
/** * 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; }
/** * MG_Twitter * * 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: 5 * username: * title: * post_date: */ function tfuse_mgtwitter($atts, $content = null) { extract(shortcode_atts(array('items' => 5, 'username' => '', 'title' => '', 'post_date' => '', 'follow' => ''), $atts)); $return_html = ''; if (!empty($username)) { $tweets = tfuse_get_tweets($username, $items); $return_html .= '<div class="widget-container widget_twitter">'; if (!empty($title)) { $return_html .= '<h3 class="widget-title">' . tfuse_qtranslate($title) . '</h3>'; } $return_html .= '<div class="tweet_list">'; foreach ($tweets as $tweet) { if (isset($tweet->text)) { $return_html .= '<div class="tweet_item clearfix even"> <div class="tweet_image"><img src="' . $tweet->user->profile_image_url . '" width="36" height="38" alt=""></div> <div class="tweet_text"><div class="inner">' . $tweet->text . '</div></div> </div>'; } } if (!empty($follow)) { $return_html .= '<p><a href="https://twitter.com/' . $username . '" class="link-more">' . $follow . '</a></p>'; } $return_html .= '</div>'; $return_html .= '</div>'; } return $return_html; }
/** * Autentificate * * To override this shortcode in a child theme, copy this file to your child theme's * theme_config/extensions/shortcodes/shortcodes/ folder. */ function tfuse_login($atts, $content = null) { extract(shortcode_atts(array('title' => ''), $atts)); $return_html = ''; if (!is_user_logged_in()) { $return_html = '<div class="widget-container widget_login"> <h3 class="widget-title">' . tfuse_qtranslate($title) . '</h3>'; $return_html .= '<form action="' . home_url() . '/wp-login.php" method="post" name="loginform" id="loginform" class="loginform"> <p> <label>' . __('Username', 'tfuse') . '</label><br /> <input name="log" id="user_login" class="input" value="" size="20" tabindex="10" type="text"> </p> <p> <label>' . __('Password', 'tfuse') . '</label><br /> <input name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20" type="password"> </p> <div class="forgetmenot input_styled checklist"> <input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" checked /><label for="rememberme">' . __('Remember Me', 'tfuse') . '</label> </div> <p class="forget_password"><a href="' . home_url() . '/wp-login.php?action=lostpassword">' . __('Forgot Password?', 'tfuse') . '</a></p> <p class="submit"> <input type="submit" name="wp-submit" id="submit" class="btn btn-black" value="' . __('Login', 'tfuse') . '" tabindex="100" /> <input type="hidden" name="redirect_to" value="' . home_url() . '/wp-admin/" /> <input type="hidden" name="testcookie" value="1" /> </p> </form> </div>'; } return $return_html; }
function widget($args, $instance) { extract($args); $current_taxonomy = $this->_get_current_taxonomy($instance); if (!empty($instance['title'])) { $title = $instance['title']; } else { if ('post_tag' == $current_taxonomy) { $title = __('Tags', 'tfuse'); } else { $tax = get_taxonomy($current_taxonomy); $title = $tax->labels->name; } } $title = apply_filters('widget_title', $title, $instance, $this->id_base); $before_widget = '<div id="tag_cloud-' . $args['widget_id'] . '" class="widget-container widget_tag_cloud">'; $after_widget = '</div>'; $before_title = '<h3 class="widget-title">'; $after_title = '</h3>'; echo $before_widget; $title = tfuse_qtranslate($title); if ($title) { echo $before_title . $title . $after_title; } echo '<div class="tagcloud">'; wp_tag_cloud(apply_filters('widget_tag_cloud_args', array('taxonomy' => $current_taxonomy))); echo "</div>\n"; echo $after_widget; }
/** * Newsletter * * To override this shortcode in a child theme, copy this file to your child theme's * theme_config/extensions/shortcodes/shortcodes/ folder. * * Optional arguments: * title: e.g. Newsletter signup * text: e.g. Thank you for your subscription. * action: URL where to send the form data. * rss_feed: */ function tfuse_newsletter($atts, $content = null) { extract(shortcode_atts(array('title' => '', 'text' => '', 'before_title' => ''), $atts)); if (!empty($title)) { $title = '<h1 class="widget-title">' . $title . '</h1>'; } if (!empty($before_title)) { $before_title = '<h3 class="widget-title-before">' . $before_title . '</h3>'; } $out = '<div class="widget widget_newsletter newsletterBox newsletter_subscription_box"> ' . tfuse_qtranslate($before_title) . ' ' . tfuse_qtranslate($title) . ' <div class="widget-content"><p>' . $text . '</p></div> <form action="#" method="post" class="newsletter_subscription_form"> <input type="text" value="" name="newsletter" id="newsletter" class="newsletter_subscription_email inputField" placeholder="' . __('Enter Your Email', 'tfuse') . '" /> <button type="submit" class="btn btn-newsletter newsletter_subscription_submit" value="Send" title="Subscribe"><span class="tficon-row"></span></button> <div class="newsletter_subscription_ajax">' . __('Loading...', 'tfuse') . '</div> </form> <div class="newsletter_subscription_messages before-text"> <div class="newsletter_subscription_message_success"> ' . __('Thank you for your subscription.', 'tfuse') . ' </div> <div class="newsletter_subscription_message_wrong_email"> ' . __('Your email format is wrong!', 'tfuse') . ' </div> <div class="newsletter_subscription_message_failed"> ' . __('Sad, but we couldn\'t add you to our mailing list ATM.', 'tfuse') . ' </div> </div> </div>'; return $out; }
function widget($args, $instance) { extract($args); $current_taxonomy = $this->_get_current_taxonomy($instance); if (!empty($instance['title'])) { $title = $instance['title']; } else { if ('post_tag' == $current_taxonomy) { $title = __('Tags', 'tfuse'); } else { $tax = get_taxonomy($current_taxonomy); $title = $tax->labels->name; } } $title = apply_filters('widget_title', $title, $instance, $this->id_base); $b = $instance['b'] = empty($instance['b']) ? '' : $instance['b']; $class = $b ? 'widget-boxed' : ''; $before_widget = '<div class="widget widget_tag_cloud ' . $class . '">'; $after_widget = '</div>'; $before_title = '<h3 class="widget-title">'; $after_title = '</h3>'; echo $before_widget; $title = tfuse_qtranslate($title); if ($title) { } ?> <?php echo $before_title . $title . $after_title; echo '<div class="tagcloud clearfix">'; if ($instance['taxonomy'] != 'category') { $posttags = get_tags(); if ($posttags) { $count = 0; foreach ($posttags as $tag) { $count++; if ($count == count($posttags)) { echo '<a href="' . get_tag_link($tag->term_id) . '">' . $tag->name . '</a>'; } else { echo '<a href="' . get_tag_link($tag->term_id) . '">' . $tag->name . ' </a>'; } } } } else { $posttags = get_categories(); if ($posttags) { $count = 0; foreach ($posttags as $tag) { $count++; if ($count == count($posttags)) { echo '<a href="' . get_category_link($tag->term_id) . '">' . $tag->name . '</a>'; } else { echo '<a href="' . get_category_link($tag->term_id) . '">' . $tag->name . ' </a>'; } } } } echo "</div>\n"; echo $after_widget; }
/** * Flickr * * To override this shortcode in a child theme, copy this file to your child theme's * theme_config/extensions/shortcodes/shortcodes/ folder. * * Optional arguments: * title: * flickr_id: * items: */ function tfuse_flickr($atts, $content) { extract(shortcode_atts(array('items' => 9, 'flickr_id' => '', 'title' => ''), $atts)); if (!empty($title)) { $title = '<h2>' . tfuse_qtranslate($title) . '</h2>'; } return '<div class="flickr">' . $title . '<script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?count=' . $items . '&display=random&size=s&layout=x&source=user&user='******'"></script><div class="clear"/></div></div>'; }
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; }
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) { global $post; extract($args); $title = esc_attr($instance['title']); $pages = isset($instance['pages']) ? $instance['pages'] : ''; $before_widget = '<div class="widget-container widget_pages">'; $after_widget = '</div>'; $before_title = '<h3 class="widget-title">'; $after_title = '</h3>'; echo $before_widget; $title = tfuse_qtranslate($title); if ($title) { echo $before_title . $title . $after_title; } ?> <?php if (is_array($pages)) { ?> <ul> <?php $k = 0; foreach ($pages as $key => $val) { $k++; if ($k == 1) { $first = ' first '; } else { $first = ''; } if ($k == count($pages)) { $last = ' last '; } else { $last = ''; } if ($key == get_query_var('page_id')) { $active = ' current-menu-item '; } else { $active = ''; } $page = get_post($key); echo '<li class="' . $first . $last . $active . '"><a href="' . get_page_link($key) . '"><span>' . $page->post_title . '</span></a></li>'; $page = get_post($key); } ?> </ul> <?php } echo $after_widget; }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Meta', 'tfuse') : $instance['title'], $instance, $this->id_base); $before_widget = ' <div id="meta-' . $args['widget_id'] . '" class="widget-container widget_meta">'; $after_widget = '</div>'; $before_title = '<h3 class="widget-title">'; $after_title = '</h3>'; echo $before_widget; $title = tfuse_qtranslate($title); if ($title) { echo $before_title . $title . $after_title; } ?> <ul> <?php wp_register(); ?> <li><?php wp_loginout(); ?> </li> <li><a href="<?php bloginfo('rss2_url'); ?> " title="<?php echo esc_attr(__('Syndicate this site using RSS 2.0', 'tfuse')); ?> "><?php _e('Entries <abbr title="Really Simple Syndication">RSS</abbr>'); ?> </a></li> <li><a href="<?php bloginfo('comments_rss2_url'); ?> " title="<?php echo esc_attr(__('The latest comments to all posts in RSS', 'tfuse')); ?> "><?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?> </a></li> <li><a href="http://wordpress.org/" title="<?php echo esc_attr(__('Powered by WordPress, state-of-the-art semantic personal publishing platform.', 'tfuse')); ?> ">WordPress.org</a></li> <?php wp_meta(); ?> </ul> <?php echo $after_widget; }
/** * Minigallery * * To override this shortcode in a child theme, copy this file to your child theme's * theme_config/extensions/shortcodes/shortcodes/ folder. * * Optional arguments: * id: post/page id * order: ASC, DESC * orderby: * include: * exclude: * pretty: true/false use or not prettyPhoto * icon_plus: * class: css class e.g. boxed * carousel: jCarousel Configuration. http://sorgalla.com/projects/jcarousel/ */ function tfuse_minigallery($attr, $content = null) { extract(shortcode_atts(array('title' => '', 'id' => ''), $attr)); global $post; extract(shortcode_atts(array('order' => 'ASC', 'orderby' => 'menu_order ID', 'id' => isset($post->ID) ? $post->ID : $attr['id'], 'include' => '', 'exclude' => '', 'pretty' => true, 'carousel' => 'easing: "easeInOutQuint",animation: 600', 'class' => 'boxed', 'prettyphoto' => ''), $attr)); $attachments = get_children(array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby)); if (empty($attachments)) { return ''; } $uniq = rand(1, 200); $out = '<h2>' . tfuse_qtranslate($title) . '</h2> <div class="minigallery_carousel"> <div class="carousel_content"> <ul id="minigallery' . $uniq . '">'; foreach ($attachments as $id => $attachment) { $link = wp_get_attachment_image_src($id, 'full', true); $image_link_attach = $link[0]; $imgsrc = wp_get_attachment_image_src($id, array(92, 92), false); $image_src = $imgsrc[0]; $image = new TF_GET_IMAGE(); $img = $image->width(92)->height(92)->properties(array('alt' => $attachment->post_title))->src($image_src)->get_img(); if ($prettyphoto == 'true') { $out .= '<li><a href="' . $image_link_attach . '" data-rel="prettyPhoto[mg' . $uniq . ']" class="zoom" rel="prettyPhoto[mg' . $uniq . ']">' . $img . '</a></li>'; } else { $out .= '<li>' . $img . '</li>'; } } $out .= '</ul> </div><a class="prev" id="minigallery' . $uniq . '_prev" href="#"><span class="tficon-shevron-left"></span></a><a class="next" id="minigallery' . $uniq . '_next" href="#"><span class="tficon-shevron-right"></span></a> </div>'; $out .= ' <script> jQuery(document).ready(function() { function mini_gallery_start(){ jQuery("#minigallery' . $uniq . '").carouFredSel({ next : "#minigallery' . $uniq . '_next", prev : "#minigallery' . $uniq . '_prev", auto: false, circular: false, infinite: true, width: "100%", scroll: { items : 1 } }); } mini_gallery_start(); jQuery("ul.tabs li").click(function(){ mini_gallery_start(); }); }); </script>'; return $out; }
function widget($args, $instance) { global $comments, $comment; $cache = wp_cache_get('widget_recent_comments', 'widget'); if (!is_array($cache)) { $cache = array(); } if (isset($cache[$args['widget_id']])) { echo $cache[$args['widget_id']]; return; } extract($args, EXTR_SKIP); $output = ''; $title = apply_filters('widget_title', $instance['title']); $before_widget = '<div class="widget widget_recent_comments">'; $after_widget = '</div>'; $before_title = '<h3 class="widget-title">'; $after_title = '</h3>'; if (!($number = (int) $instance['number'])) { $number = 5; } else { if ($number < 1) { $number = 1; } } $comments = get_comments(array('number' => $number, 'status' => 'approve')); $output .= $before_widget; $title = tfuse_qtranslate($title); if (!empty($title)) { $output .= $before_title . $title . $after_title; } $output .= '<ul class="comments-list">'; if ($comments) { foreach ((array) $comments as $comment) { $commentContent = $this->get_comment_preview($comment->comment_content); if (!$comment->comment_author_url) { $comment->comment_author_url = '#'; } $output .= '<li class="recentcomments">'; $output .= '<a href="' . esc_url(get_comment_link($comment->comment_ID)) . '" class="comment-link">' . $commentContent . '</a>'; $output .= '<div class="comment-meta"><span class="author">' . __('by', 'tfuse'); $output .= ' <a href="' . $comment->comment_author_url . '" rel="external nofollow" class="url">' . $comment->comment_author . '</a>'; $output .= '</span> <span class="comment-date">' . get_comment_date() . '</span></div>'; $output .= '</li>'; } } $output .= '</ul>'; $output .= $after_widget; echo $output; $cache[$args['widget_id']] = $output; wp_cache_set('widget_recent_comments', $cache, 'widget'); }
function widget($args, $instance) { global $comments, $comment; $cache = wp_cache_get('widget_recent_comments', 'widget'); if (!is_array($cache)) { $cache = array(); } if (isset($cache[$args['widget_id']])) { echo $cache[$args['widget_id']]; return; } extract($args, EXTR_SKIP); $output = ''; $b = $instance['b'] = empty($instance['b']) ? '' : $instance['b']; $class = $b ? 'widget-boxed' : ''; $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Comments', 'tfuse') : $instance['title']); $instance['position'] = empty($instance['position']) ? '' : $instance['position']; $before_widget = '<div class="widget widget_recent_comments ' . $class . '">'; $after_widget = '</div>'; $before_title = ' <h3 class="widget-title">'; $after_title = '</h3>'; if (!($number = (int) $instance['number'])) { $number = 5; } else { if ($number < 1) { $number = 1; } } $comments = get_comments(array('number' => $number, 'status' => 'approve')); $output .= $before_widget; $title = tfuse_qtranslate($title); if ($title) { $output .= $before_title . $title . $after_title; } $output .= '<ul class="side-postlist">'; if ($comments) { foreach ((array) $comments as $comment) { $avatar = get_avatar($comment->comment_author_email, 62); $output .= '<li class="recentcomments">' . sprintf(__('%1$s: %2$s', 'widgets'), '<a href="' . esc_url(get_comment_link($comment->comment_ID)) . '" class="post-thumbnail"><span class="thumb">' . $avatar . '</span></a>' . '<span class="recent-comment"> <a href="' . $comment->comment_author_url . '" class="url">' . get_comment_author_link(), '</a>' . $comment->comment_content . ' </span>') . '</li>'; } } $output .= '</ul>'; $output .= $after_widget; echo $output; $cache[$args['widget_id']] = $output; wp_cache_set('widget_recent_comments', $cache, 'widget'); }
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; }
/** * Search form * * To override this shortcode in a child theme, copy this file to your child theme's * theme_config/extensions/shortcodes/shortcodes/ folder. */ function tfuse_search($atts) { extract(shortcode_atts(array('title' => ''), $atts)); if (empty($title)) { $title = __('SEARCH WIDGET', 'tfuse'); } $output = ''; $output .= '<div class="widget widget-search"> <h3 class="widget-title">' . tfuse_qtranslate($title) . '</h3> <form method="get" id="searchform" action="' . home_url('/') . '"> <input name="s" id="s" type="text" class="inputtext" placeholder="' . tfuse_options('search_box_text') . '" name="search" value=""> <button id="searchsubmit" type="submit" class="btn btn-search"><span class="tficon-row"></span></button> </form> </div>'; return $output; }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base); $before_widget = ' <div id="calendar-' . $args['widget_id'] . '" class="widget widget_calendar"> '; $after_widget = '</div>'; $before_title = '<h3 class="widget-title">'; $after_title = '</h3>'; echo $before_widget; if ($title) { echo $before_title . tfuse_qtranslate($title) . $after_title; } echo '<div id="calendar_wrap">'; get_calendar(); echo '</div>'; 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 }
/** * Twitter * * 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: 5 * username: * title: * post_date: */ function tfuse_twitter($atts, $content = null) { extract(shortcode_atts(array('items' => 5, 'username' => '', 'title' => '', 'post_date' => ''), $atts)); $return_html = ''; if (!empty($username)) { $tweets = tfuse_get_tweets($username, $items); $return_html .= '<div class="twitter">'; if (!empty($title)) { $return_html .= '<h2>' . tfuse_qtranslate($title) . '</h2><ul>'; } foreach ($tweets as $tweet) { if (isset($tweet->text)) { $return_html .= '<li>' . $tweet->text . '</li>'; } } $return_html .= '</ul></div>'; } return $return_html; }
function widget($args, $instance) { global $comments, $comment; $cache = wp_cache_get('widget_recent_comments', 'widget'); if (!is_array($cache)) { $cache = array(); } if (isset($cache[$args['widget_id']])) { echo $cache[$args['widget_id']]; return; } extract($args, EXTR_SKIP); $output = ''; $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Comments', 'tfuse') : $instance['title']); $before_widget = '<div class="widget-container widget_recent_comments">'; $after_widget = '</div>'; $before_title = ' <h3 class="widget-title">'; $after_title = '</h3>'; if (!($number = (int) $instance['number'])) { $number = 5; } else { if ($number < 1) { $number = 1; } } $comments = get_comments(array('number' => $number, 'status' => 'approve')); $output .= $before_widget; $title = tfuse_qtranslate($title); if ($title) { $output .= $before_title . $title . $after_title; } $output .= '<ul id="recentcomments">'; if ($comments) { foreach ((array) $comments as $comment) { $output .= '<li class="recentcomments">' . sprintf(__('%1$s on %2$s', 'widgets'), get_comment_author_link(), '<a href="' . esc_url(get_comment_link($comment->comment_ID)) . '">' . get_the_title($comment->comment_post_ID) . '</a>') . '</li>'; } } $output .= '</ul>'; $output .= $after_widget; echo $output; $cache[$args['widget_id']] = $output; wp_cache_set('widget_recent_comments', $cache, 'widget'); }
/** * 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 widget($args, $instance) { // Get menu $nav_menu = wp_get_nav_menu_object($instance['nav_menu']); if (!$nav_menu) { return; } $instance['title'] = apply_filters('widget_title', $instance['title'], $instance, $this->id_base); $args['before_widget'] = '<div id="categories-' . $args['widget_id'] . '" class="widget-container widget_nav_menu">'; $args['after_widget'] = '</div>'; $args['before_title'] = '<h3 class="widget-title">'; $args['after_title'] = '</h3>'; echo $args['before_widget']; $instance['title'] = tfuse_qtranslate($instance['title']); if (!empty($instance['title'])) { echo $args['before_title'] . $instance['title'] . $args['after_title']; } wp_nav_menu(array('fallback_cb' => '', 'menu' => $nav_menu, 'link_before' => '<span>', 'link_after' => '</span>')); echo $args['after_widget']; }