function get_social_network_meta($service_id, $user_id, &$td_social_api) { switch ($service_id) { case 'facebook': return array('button' => __td('Like'), 'url' => "https://www.facebook.com/{$user_id}", 'text' => __td('Fans'), 'api' => $td_social_api->get_social_counter($service_id, $user_id)); break; case 'twitter': return array('button' => __td('Follow'), 'url' => "https://twitter.com/{$user_id}", 'text' => __td('Followers'), 'api' => $td_social_api->get_social_counter($service_id, $user_id)); break; case 'vimeo': return array('button' => __td('Like'), 'url' => "http://vimeo.com/{$user_id}", 'text' => __td('Likes'), 'api' => $td_social_api->get_social_counter($service_id, $user_id)); break; case 'youtube': return array('button' => __td('Subscribe'), 'url' => strpos('channel/', $user_id) >= 0 ? "http://www.youtube.com/{$user_id}" : "http://www.youtube.com/user/{$user_id}", 'text' => __td('Subscribers'), 'api' => $td_social_api->get_social_counter($service_id, $user_id)); break; case 'googleplus': return array('button' => __td('+1'), 'url' => "https://plus.google.com/{$user_id}", 'text' => __td('Subscribers'), 'api' => $td_social_api->get_social_counter($service_id, $user_id)); break; case 'instagram': return array('button' => __td('Follow'), 'url' => "http://instagram.com/{$user_id}#", 'text' => __td('Followers'), 'api' => $td_social_api->get_social_counter($service_id, $user_id)); break; case 'soundcloud': return array('button' => __td('Follow'), 'url' => "https://soundcloud.com/{$user_id}", 'text' => __td('Followers'), 'api' => $td_social_api->get_social_counter($service_id, $user_id)); break; case 'rss': return array('button' => __td('Follow'), 'url' => get_bloginfo('rss2_url'), 'text' => __td('Followers'), 'api' => $td_social_api->get_social_counter($service_id, $user_id)); break; } }
function get_block_sub_cats($atts) { extract(shortcode_atts(array('limit' => 5, 'sort' => '', 'category_id' => '', 'category_ids' => '', 'custom_title' => '', 'custom_url' => '', 'hide_title' => '', 'show_child_cat' => '', 'sub_cat_ajax' => ''), $atts)); $buffy = ''; if (!empty($show_child_cat) and !empty($category_id)) { $td_subcategories = get_categories(array('child_of' => $category_id)); if (!empty($td_subcategories)) { if ($show_child_cat != 'all') { $td_subcategories = array_slice($td_subcategories, 0, $show_child_cat); } $buffy .= '<div class="block-mega-child-cats">'; //show all categories only on ajax if (empty($sub_cat_ajax)) { $buffy .= '<div><a class="cur-sub-cat ajax-sub-cat-mega sub-cat-' . $this->block_uid . '" id="sub-cat-' . $this->block_uid . '-' . $category_id . '" data-cat_id="' . $category_id . '" data-td_block_id="' . $this->block_uid . '" href="' . get_category_link($category_id) . '">' . __td('All') . '</a></div>'; } foreach ($td_subcategories as $td_category) { if (empty($sub_cat_ajax)) { $buffy .= '<div><a class="ajax-sub-cat-mega sub-cat-' . $this->block_uid . '" id="sub-cat-' . $this->block_uid . '-' . $td_category->cat_ID . '" data-cat_id="' . $td_category->cat_ID . '" data-td_block_id="' . $this->block_uid . '" href="' . get_category_link($td_category->cat_ID) . '">' . $td_category->name . '</a></div>'; } else { $buffy .= '<div><a href="' . get_category_link($td_category->cat_ID) . '">' . $td_category->name . '</a></div>'; } } $buffy .= '</div>'; } else { //there are no subcategories, return false - this is used by the mega menu block to alter it's structure return false; } } return $buffy; }
function render($atts, $content = null) { parent::render($atts); // sets the live atts, $this->atts, $this->block_uid, $this->td_query (it runs the query) // this block need td_column_number to add rows if more posts are displayed on a post. /// the td_column_number is not standard here, it's 5 for full width / 3 for content + sidebar extract(shortcode_atts(array('td_column_number' => ''), $atts)); // we have no related posts to display if ($this->td_query->post_count == 0) { return; } $buffy = ''; //output buffer //get the js for this block $buffy .= $this->get_block_js(); $buffy .= '<div class="' . $this->get_block_classes() . '">'; //get the filter for this block $buffy .= '<h4 class="td-related-title">'; $buffy .= '<a id="' . td_global::td_generate_unique_id() . '" class="td-related-left td-cur-simple-item" data-td_filter_value="" data-td_block_id="' . $this->block_uid . '" href="#">' . __td('RELATED ARTICLES', TD_THEME_NAME) . '</a>'; $buffy .= '<a id="' . td_global::td_generate_unique_id() . '" class="td-related-right" data-td_filter_value="td_related_more_from_author" data-td_block_id="' . $this->block_uid . '" href="#">' . __td('MORE FROM AUTHOR', TD_THEME_NAME) . '</a>'; $buffy .= '</h4>'; $buffy .= '<div id=' . $this->block_uid . ' class="td_block_inner">'; $buffy .= $this->inner($this->td_query->posts, $td_column_number); //inner content of the block $buffy .= '</div>'; //get the ajax pagination for this block $buffy .= $this->get_block_pagination(); $buffy .= '</div> <!-- ./block -->'; return $buffy; }
function widget($args, $instance) { $buffy = ''; $buffy .= '<div class="footer-logo-wrap">'; if (!empty($instance['logo_url_r'])) { $buffy .= '<img class="td-retina-data" src="' . $instance['logo_url'] . '" data-retina="' . htmlentities($instance['logo_url_r']) . '" alt=""/>'; } else { $buffy .= '<img src="' . $instance['logo_url'] . '" alt=""/>'; } $buffy .= '</div>'; $buffy .= '<div class="footer-text-wrap">'; $buffy .= $instance['footer_text']; $buffy .= '</div>'; if (!empty($instance['footer_text_2'])) { $buffy .= '<div class="footer-text-wrap">'; $buffy .= $instance['footer_text_2']; $buffy .= '</div>'; } if (!empty($instance['footer_email'])) { $buffy .= '<div class="footer-email-wrap">'; $buffy .= __td('Contact us') . ': <a href="mailto:' . $instance['footer_email'] . '">' . $instance['footer_email'] . '</a>'; $buffy .= '</div>'; } //print_r($instance); echo $buffy; }
function render($atts, $content = null) { parent::render($atts); // sets the live atts, $this->atts, $this->block_uid, $this->td_query (it runs the query) // we have no related posts to display if ($this->td_query->post_count == 0) { return; } $buffy = ''; //output buffer //get the js for this block $buffy .= $this->get_block_js(); $buffy .= '<div class="' . $this->get_block_classes() . '">'; //get the filter for this block $buffy .= '<h4 class="td-related-title">'; $buffy .= '<a id="' . td_global::td_generate_unique_id() . '" class="td-related-left td-cur-simple-item" data-td_filter_value="" data-td_block_id="' . $this->block_uid . '" href="#">' . __td('RELATED ARTICLES') . '</a>'; $buffy .= '<a id="' . td_global::td_generate_unique_id() . '" class="td-related-right" data-td_filter_value="td_related_more_from_author" data-td_block_id="' . $this->block_uid . '" href="#">' . __td('MORE FROM AUTHOR') . '</a>'; $buffy .= '</h4>'; $buffy .= '<div id=' . $this->block_uid . ' class="td_block_inner">'; $buffy .= $this->inner($this->td_query->posts); //inner content of the block $buffy .= '</div>'; //get the ajax pagination for this block $buffy .= $this->get_block_pagination(); $buffy .= '</div> <!-- ./block -->'; return $buffy; }
function render() { ob_start(); ?> <div class="td_mod_wrap td_mod8 <?php echo $this->get_no_thumb_class(); ?> " <?php echo $this->get_item_scope(); ?> > <?php echo $this->get_image('art-big-1col'); ?> <div class="item-details"> <?php echo $this->get_title(td_util::get_option('tds_mod8_title_excerpt')); ?> <div class="meta-info"> <?php //echo $this->get_author(); ?> <?php echo $this->get_date(); ?> <?php echo $this->get_commentsAndViews(); ?> </div> <p><div class="td-post-text-excerpt"><?php echo $this->get_excerpt(td_util::get_option('tds_mod8_content_excerpt')); ?> </div></p> <div class="more-link-wrap wpb_button td_read_more clearfix"> <a href="<?php echo $this->href; ?> "><?php echo __td('Continue', TD_THEME_NAME); ?> </a> </div> </div> <?php echo $this->get_item_scope_meta(); ?> </div> <?php return ob_get_clean(); }
function render() { ob_start(); ?> <div class="<?php echo $this->get_module_classes(); ?> "> <div class="meta-info-container"> <?php echo $this->get_image('td_696x385'); ?> <div class="td-module-meta-info"> <div class="td-module-meta-holder"> <?php echo $this->get_title(); ?> <?php if (td_util::get_option('tds_category_module_14') == 'yes') { echo $this->get_category(); } ?> <?php echo $this->get_author(); ?> <?php echo $this->get_date(); ?> <?php echo $this->get_comments(); ?> </div> </div> </div> <div class="td-excerpt"> <?php echo $this->get_excerpt(); ?> <div class="td-read-more"> <a href="<?php echo $this->href; ?> "><?php echo __td('Read more', TD_THEME_NAME); ?> </a> </div> </div> </div> <?php return ob_get_clean(); }
function render() { ob_start(); ?> <div class="<?php echo $this->get_module_classes(); ?> " <?php echo $this->get_item_scope(); ?> > <div class="item-details"> <?php echo $this->get_title(); ?> <div class="td-module-meta-info"> <?php if (td_util::get_option('tds_category_module_13') == 'yes') { echo $this->get_category(); } ?> <?php echo $this->get_author(); ?> <?php echo $this->get_date(); ?> <?php echo $this->get_comments(); ?> </div> <?php echo $this->get_image('td_696x0'); ?> <div class="td-read-more"> <a href="<?php echo $this->href; ?> "><?php echo __td('Read more', TD_THEME_NAME); ?> </a> </div> </div> <?php echo $this->get_item_scope_meta(); ?> </div> <?php return ob_get_clean(); }
function get_social_sharing_bottom() { if (!$this->is_single) { return; } if (td_util::get_option('tds_bottom_social_show') == 'hide' and td_util::get_option('tds_bottom_like_tweet_show') == 'hide') { return; } // used to style the sharing icon to be big on tablet $td_no_like = ''; if (td_util::get_option('tds_bottom_like_tweet_show') != 'hide') { $td_no_like = 'td-with-like'; } $buffy = ''; // @todo single-post-thumbnail appears to not be in used! please check $image = wp_get_attachment_image_src(get_post_thumbnail_id($this->post->ID), 'single-post-thumbnail'); $buffy .= '<div class="td-post-sharing td-post-sharing-bottom ' . $td_no_like . '"><span class="td-post-share-title">' . __td('SHARE', TD_THEME_NAME) . '</span>'; if (td_util::get_option('tds_bottom_social_show') != 'hide') { $twitter_user = td_util::get_option('tds_tweeter_username'); /** * get Pinterest share description * get it from SEO by Yoast meta (if the plugin is active and the description is set) else use the post title */ if (is_plugin_active('wordpress-seo/wp-seo.php') and get_post_meta($this->post->ID, '_yoast_wpseo_metadesc', true) != '') { $td_pinterest_share_description = get_post_meta($this->post->ID, '_yoast_wpseo_metadesc', true); } else { $td_pinterest_share_description = htmlspecialchars(urlencode(html_entity_decode($this->title, ENT_COMPAT, 'UTF-8')), ENT_COMPAT, 'UTF-8'); } //default share buttons $buffy .= ' <div class="td-default-sharing"> <a class="td-social-sharing-buttons td-social-facebook" href="http://www.facebook.com/sharer.php?u=' . urlencode(esc_url(get_permalink())) . '" onclick="window.open(this.href, \'mywin\',\'left=50,top=50,width=600,height=350,toolbar=0\'); return false;"><i class="td-icon-facebook"></i><div class="td-social-but-text">Facebook</div></a> <a class="td-social-sharing-buttons td-social-twitter" href="https://twitter.com/intent/tweet?text=' . htmlspecialchars(urlencode(html_entity_decode($this->title, ENT_COMPAT, 'UTF-8')), ENT_COMPAT, 'UTF-8') . '&url=' . urlencode(esc_url(get_permalink())) . '&via=' . urlencode($twitter_user ? $twitter_user : get_bloginfo('name')) . '"><i class="td-icon-twitter"></i><div class="td-social-but-text">Twitter</div></a> <a class="td-social-sharing-buttons td-social-google" href="http://plus.google.com/share?url=' . esc_url(get_permalink()) . '" onclick="window.open(this.href, \'mywin\',\'left=50,top=50,width=600,height=350,toolbar=0\'); return false;"><i class="td-icon-googleplus"></i></a> <a class="td-social-sharing-buttons td-social-pinterest" href="http://pinterest.com/pin/create/button/?url=' . esc_url(get_permalink()) . '&media=' . (!empty($image[0]) ? $image[0] : '') . '&description=' . $td_pinterest_share_description . '" onclick="window.open(this.href, \'mywin\',\'left=50,top=50,width=600,height=350,toolbar=0\'); return false;"><i class="td-icon-pinterest"></i></a> <a class="td-social-sharing-buttons td-social-whatsapp" href="whatsapp://send?text=' . htmlspecialchars(urlencode(html_entity_decode($this->title, ENT_COMPAT, 'UTF-8')), ENT_COMPAT, 'UTF-8') . ' - ' . urlencode(esc_url(get_permalink())) . '" ><i class="td-icon-whatsapp"></i></a> </div>'; } if (td_util::get_option('tds_bottom_like_tweet_show') != 'hide') { //classic share buttons $buffy .= '<div class="td-classic-sharing">'; $buffy .= '<ul>'; $buffy .= '<li class="td-classic-facebook">'; $buffy .= '<iframe frameBorder="0" src="' . td_global::$http_or_https . '://www.facebook.com/plugins/like.php?href=' . $this->href . '&layout=button_count&show_faces=false&width=105&action=like&colorscheme=light&height=21" style="border:none; overflow:hidden; width:105px; height:21px; background-color:transparent;"></iframe>'; $buffy .= '</li>'; $buffy .= '<li class="td-classic-twitter">'; $buffy .= '<a href="https://twitter.com/share" class="twitter-share-button" data-url="' . esc_attr($this->href) . '" data-text="' . $this->title . '" data-via="' . td_util::get_option('tds_' . 'social_twitter') . '" data-lang="en">tweet</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>'; $buffy .= '</li>'; $buffy .= '</ul>'; $buffy .= '</div>'; } $buffy .= '</div>'; return $buffy; }
function get_social_sharing_bottom() { if (!$this->is_single) { return; } if (td_util::get_option('tds_bottom_social_show') == 'hide' and td_util::get_option('tds_bottom_like_tweet_show') == 'hide') { return; } // used to style the sharing icon to be big on tablet $td_no_like = ''; if (td_util::get_option('tds_bottom_like_tweet_show') != 'hide') { $td_no_like = 'td-with-like'; } $buffy = ''; // @todo single-post-thumbnail appears to not be in used! please check $image = wp_get_attachment_image_src(get_post_thumbnail_id($this->post->ID), 'single-post-thumbnail'); $buffy .= '<div class="td-post-sharing td-post-sharing-bottom ' . $td_no_like . '"><span class="td-post-share-title">' . __td('SHARE', TD_THEME_NAME) . '</span>'; if (td_util::get_option('tds_bottom_social_show') != 'hide') { $twitter_user = td_util::get_option('tds_tweeter_username'); //default share buttons $buffy .= ' <div class="td-default-sharing"> <a class="td-social-sharing-buttons td-social-facebook" href="http://www.facebook.com/sharer.php?u=' . urlencode(esc_url(get_permalink())) . '" onclick="window.open(this.href, \'mywin\',\'left=50,top=50,width=600,height=350,toolbar=0\'); return false;"><i class="td-icon-facebook"></i><div class="td-social-but-text">Facebook</div></a> <a class="td-social-sharing-buttons td-social-twitter" href="https://twitter.com/intent/tweet?text=' . htmlspecialchars(urlencode(html_entity_decode($this->title, ENT_COMPAT, 'UTF-8')), ENT_COMPAT, 'UTF-8') . '&url=' . urlencode(esc_url(get_permalink())) . '&via=' . urlencode($twitter_user ? $twitter_user : get_bloginfo('name')) . '"><i class="td-icon-twitter"></i><div class="td-social-but-text">Twitter</div></a> <a class="td-social-sharing-buttons td-social-google" href="http://plus.google.com/share?url=' . esc_url(get_permalink()) . '" onclick="window.open(this.href, \'mywin\',\'left=50,top=50,width=600,height=350,toolbar=0\'); return false;"><i class="td-icon-googleplus"></i></a> <a class="td-social-sharing-buttons td-social-pinterest" href="http://pinterest.com/pin/create/button/?url=' . esc_url(get_permalink()) . '&media=' . (!empty($image[0]) ? $image[0] : '') . '" onclick="window.open(this.href, \'mywin\',\'left=50,top=50,width=600,height=350,toolbar=0\'); return false;"><i class="td-icon-pinterest"></i></a> </div>'; } if (td_util::get_option('tds_bottom_like_tweet_show') != 'hide') { //classic share buttons $buffy .= '<!-- JiaThis Button BEGIN --> <div class="jiathis_style_32x32"> <a class="jiathis_button_qzone"></a> <a class="jiathis_button_tsina"></a> <a class="jiathis_button_tqq"></a> <a class="jiathis_button_weixin"></a> <a class="jiathis_button_renren"></a> <a href="http://www.jiathis.com/share?uid=2037753" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a> </div> <script type="text/javascript">'; $buffy .= "var jiathis_config = {data_track_clickback:'true'};"; $buffy .= '</script> <script type="text/javascript" src="http://v3.jiathis.com/code/jia.js?uid=2037753" charset="utf-8"></script> <!-- JiaThis Button END -->'; } $buffy .= '</div>'; return $buffy; }
function render_before_list_wrap() { if (td_global::$cur_single_template_sidebar_pos == 'no_sidebar') { $td_class_nr_of_columns = ' td-3-columns '; } else { $td_class_nr_of_columns = ' td-2-columns '; } $buffy = ''; //generate unique gallery slider id $this->smart_list_tip_1_unique_id = 'smart_list_tip1_' . td_global::td_generate_unique_id(); //wrapper with id for smart list wrapper type 1 $buffy .= '<div class="td_smart_list_1' . $td_class_nr_of_columns . '">'; $buffy .= '<div class="td-controls"><a class="td-left-smart-list doubleSliderPrevButton" href="#" onclick="return false;"><i class = "td-icon-left"></i>' . __td('Prev', TD_THEME_NAME) . '</a><a class="td-right-smart-list doubleSliderNextButton" href="#" onclick="return false;">' . __td('Next', TD_THEME_NAME) . '<i class = "td-icon-right"></i></a></div>'; $buffy .= '<div class="td-iosSlider td-smart-list-slider" id="' . $this->smart_list_tip_1_unique_id . '">'; $buffy .= '<div class ="td-slider">'; return $buffy; }
function td_js_generator() { td_js_buffer::add_variable('td_ajax_url', admin_url('admin-ajax.php')); td_js_buffer::add_variable('td_get_template_directory_uri', get_template_directory_uri()); td_js_buffer::add_variable('tds_snap_menu', td_util::get_option('tds_snap_menu')); td_js_buffer::add_variable('tds_header_style', td_util::get_option('tds_header_style')); td_js_buffer::add_variable('tds_mobile_swipe', td_util::get_option('tds_mobile_swipe')); td_js_buffer::add_variable('td_search_url', get_search_link()); td_js_buffer::add_variable('td_please_wait', str_replace(array('"', "'"), array('`'), __td("Please wait..."))); td_js_buffer::add_variable('td_email_user_pass_incorrect', str_replace(array('"', "'"), array('`'), __td("User or password incorrect!"))); td_js_buffer::add_variable('td_email_user_incorrect', str_replace(array('"', "'"), array('`'), __td("Email or username incorrect!"))); td_js_buffer::add_variable('td_email_incorrect', str_replace(array('"', "'"), array('`'), __td("Email incorrect!"))); //use for more articles on post pages td_js_buffer::add_variable('tds_more_articles_on_post_enable', td_util::get_option('tds_more_articles_on_post_pages_enable')); td_js_buffer::add_variable('tds_more_articles_on_post_time_to_wait', td_util::get_option('tds_more_articles_on_post_pages_time_to_wait')); td_js_buffer::add_variable('tds_more_articles_on_post_pages_distance_from_top', intval(td_util::get_option('tds_more_articles_on_post_pages_distance_from_top'))); td_js_buffer::add("\nvar td_blocks = []; //here we store all the items for the current page\n\n//td_block class - each ajax block uses a object of this class for requests\nfunction td_block() {\n this.id = '';\n this.block_type = 1; //block type id (1-234 etc)\n this.atts = '';\n this.td_cur_cat = '';\n this.td_column_number = '';\n this.td_current_page = 1; //\n this.post_count = 0; //from wp\n this.found_posts = 0; //from wp\n this.max_num_pages = 0; //from wp\n this.is_ajax_running = false;\n this.header_color = '';\n}\n\n "); }
function get_author($show_stars_on_review = true) { $buffy = ''; if (td_review::has_review($this->td_review) and $show_stars_on_review === true) { //if review do nothing // $buffy .= '<div class="entry-review-stars">'; // $buffy .= td_review::render_stars($this->td_review); // $buffy .= '</div>'; } else { $td_article_date_unix = get_the_time('U', $this->post->ID); $buffy .= '<span class="td-block-author">'; $buffy .= __td('by', TD_THEME_NAME); $buffy .= ' '; $buffy .= get_the_author_meta('display_name', $this->post->post_author); $buffy .= '</span>'; $buffy .= '<meta itemprop="interactionCount" content="UserComments:' . get_comments_number($this->post->ID) . '"/>'; //$buffy .= '<meta itemprop="dateCreated" content="' . get_the_time(get_option('date_format'), $this->post->ID) . '"/>'; } return $buffy; }
function render($atts, $content = null) { parent::render($atts); // sets the live atts, $this->atts, $this->block_uid, $this->td_query (it runs the query) // this block need td_column_number to add rows if more posts are displayed on a post. /// the td_column_number is not standard here, it's 5 for full width / 3 for content + sidebar extract(shortcode_atts(array('td_column_number' => ''), $atts)); // we have no related posts to display if ($this->td_query->post_count == 0) { return; } $buffy = ''; //output buffer //get the js for this block $buffy .= $this->get_block_js(); $buffy .= '<div class="' . $this->get_block_classes() . '">'; //get the filter for this block $buffy .= '<h4 class="td-related-title">'; // $buffy .= '<a id="' . td_global::td_generate_unique_id() . '" class="td-related-left td-cur-simple-item" data-td_filter_value="" data-td_block_id="' . $this->block_uid . '" href="#">' . __td('RELATED ARTICLES', TD_THEME_NAME) . '</a>'; $buffy .= '<span class="title-inner">' . __td('RELATED ARTICLES', TD_THEME_NAME) . '</span>'; // ZA Custom $buffy .= '<div id="related-filter">Filter <img src="/wp-content/uploads/2015/12/icon-caret-down_white.png" alt=""></div>'; $buffy .= '<div class="td-related-mobile">'; $buffy .= '<a id="' . td_global::td_generate_unique_id() . '" class="td-related-right " data-td_filter_value="td_related_more_from_author" data-td_block_id="' . $this->block_uid . '" href="#"><div class="td-related-mobile-inner"><div class="icon-title"><img class="NEUTRAL" src="/wp-content/uploads/2015/12/icon-articleNeutual.png" alt=""><img class="NEUTRAL-hover" src="/wp-content/uploads/2015/12/icon-articleNeutual-selected.png" alt=""><span> NEUTRAL</span></div></div></a>'; $buffy .= '<a id="' . td_global::td_generate_unique_id() . '" class="td-related-right" data-td_filter_value="td_tag_slug_filter_happy" data-td_block_id="' . $this->block_uid . '" href="#"><div class="td-related-mobile-inner"><div class="icon-title"><img class="HAPPY" src="/wp-content/uploads/2015/12/icon-articleHappy.png" alt=""><img class="HAPPY-hover" src="/wp-content/uploads/2015/12/icon-articleHappy-selected.png" alt=""><span> HAPPY</span></div></div></a>'; $buffy .= '<a id="' . td_global::td_generate_unique_id() . '" class="td-related-right" data-td_filter_value="td_tag_slug_filter_funny" data-td_block_id="' . $this->block_uid . '" href="#"><div class="td-related-mobile-inner"><div class="icon-title"><img class="HAPPY" src="/wp-content/uploads/2015/12/icon-articleFunny.png" alt=""><img class="HAPPY-hover" src="/wp-content/uploads/2015/12/icon-articleFunny-selected.png" alt=""><span> FUNNY</span></div></div></a>'; $buffy .= '<a id="' . td_global::td_generate_unique_id() . '" class="td-related-right" data-td_filter_value="td_tag_slug_filter_romantic" data-td_block_id="' . $this->block_uid . '" href="#"><div class="td-related-mobile-inner"><div class="icon-title"><img class="HAPPY" src="/wp-content/uploads/2015/12/icon-articleRomantic.png" alt=""><img class="HAPPY-hover" src="/wp-content/uploads/2015/12/icon-articleRomantic-selected.png" alt=""><span> ROMANTIC</span></div></div></a>'; $buffy .= '<a id="' . td_global::td_generate_unique_id() . '" class="td-related-right" data-td_filter_value="td_tag_slug_filter_surprised" data-td_block_id="' . $this->block_uid . '" href="#"><div class="td-related-mobile-inner"><div class="icon-title"><img class="HAPPY" src="/wp-content/uploads/2015/12/icon-articleSurprised.png" alt=""><img class="HAPPY-hover" src="/wp-content/uploads/2015/12/icon-articleSurprised-selected.png" alt=""><span> SURPRISED</span></div></div></a>'; $buffy .= '<a id="' . td_global::td_generate_unique_id() . '" class="td-related-right" data-td_filter_value="td_tag_slug_filter_sad" data-td_block_id="' . $this->block_uid . '" href="#"><div class="td-related-mobile-inner"><div class="icon-title"><img class="HAPPY" src="/wp-content/uploads/2015/12/icon-articleSad.png" alt=""><img class="HAPPY-hover" src="/wp-content/uploads/2015/12/icon-articleSad-selected.png" alt=""><span> SAD</span></div></div></a>'; $buffy .= '</div>'; // End ZA Custom $buffy .= '</h4>'; $buffy .= '<div id=' . $this->block_uid . ' class="td_block_inner">'; $buffy .= $this->inner($this->td_query->posts, $td_column_number); //inner content of the block $buffy .= '</div>'; //get the ajax pagination for this block $buffy .= $this->get_block_pagination(); $buffy .= '</div> <!-- ./block -->'; return $buffy; }
function inner($posts, $td_column_number = '') { $buffy = ''; $navigation = ''; if (!empty($this->atts['navigation'])) { $navigation = $this->atts['navigation']; } $td_block_layout = new td_block_layout(); if (!empty($posts)) { $buffy .= $td_block_layout->open_row(); $trending_now_unique_id = td_global::td_generate_unique_id(); //generate unique id for this object $buffy .= '<div class="td-trending-now-wrapper" id="' . $trending_now_unique_id . '" data-start="' . esc_attr($navigation) . '">'; $buffy .= '<div class="td-trending-now-title">' . __td('Trending Now', TD_THEME_NAME) . '</div><div class="td-trending-now-display-area">'; foreach ($posts as $post_count => $post) { $td_module_trending_now = new td_module_trending_now($post); $buffy .= $td_module_trending_now->render($post_count); } $buffy .= '</div>'; // ZA Cutom // $buffy .= '<div class="td-next-prev-wrap">'; // $buffy .= '<a href="#" // class="td_ajax-prev-pagex td-trending-now-nav-left" // data-wrapper-id="' . $trending_now_unique_id . '" // data-moving="left" // data-control-start="' . $navigation . '"><i class="td-icon-menu-left"></i></a>'; // $buffy .= '<a href="#" // class="td_ajax-next-pagex td-trending-now-nav-right" // data-wrapper-id="' . $trending_now_unique_id . '" // data-moving="right" // data-control-start="' . $navigation . '"><i class="td-icon-menu-right"></i></a>'; // $buffy .= '</div>'; $buffy .= '</div>'; $buffy .= $td_block_layout->close_row(); } $buffy .= $td_block_layout->close_all_tags(); return $buffy; }
/** * gets the mega menu subcategories - it works on $atts (NOT ON $this->atts ) because we have to modify the $atts (limit 4 if we have subcategories or limit 5 if we don't) * @param $atts * @return bool|string */ function get_mega_menu_subcategories($atts) { extract(shortcode_atts(array('limit' => 5, 'sort' => '', 'category_id' => '', 'category_ids' => '', 'custom_title' => '', 'custom_url' => '', 'show_child_cat' => '5', 'sub_cat_ajax' => ''), $atts)); $buffy = ''; if (!empty($show_child_cat) and !empty($category_id)) { $td_subcategories = get_categories(array('child_of' => $category_id, 'number' => $show_child_cat)); if (!empty($td_subcategories)) { $buffy .= '<div class="block-mega-child-cats">'; //show all categories only on ajax if (empty($sub_cat_ajax)) { $buffy .= '<a class="cur-sub-cat mega-menu-sub-cat-' . $this->block_uid . '" id="' . td_global::td_generate_unique_id() . '" data-td_block_id="' . $this->block_uid . '" data-td_filter_value="" href="' . get_category_link($category_id) . '">' . __td('All', TD_THEME_NAME) . '</a>'; } foreach ($td_subcategories as $td_category) { $buffy .= '<a class="mega-menu-sub-cat-' . $this->block_uid . '" id="' . td_global::td_generate_unique_id() . '" data-td_block_id="' . $this->block_uid . '" data-td_filter_value="' . $td_category->cat_ID . '" href="' . get_category_link($td_category->cat_ID) . '">' . $td_category->name . '</a>'; } $buffy .= '</div>'; } else { //there are no subcategories, return false - this is used by the mega menu block to alter it's structure return false; } } return $buffy; }
function _etd($td_string, $td_domain = '') { echo __td($td_string, $td_domain); }
<?php break; case 'sidebar_left': ?> <div class="td-pb-span8 td-main-content <?php echo $td_sidebar_position; ?> -content"> <div class="td-ss-main-content"> <div class="td-page-header"> <h1 itemprop="name" class="entry-title td-page-title"> <?php /*<a itemprop="url" href="<?php echo get_tag_link(get_query_var('tag_id'));?>" rel="bookmark" title="<?php echo __td('Posts in ') . $current_tag_name?>">Tag: <?php echo $current_tag_name ?></a>*/ ?> <span><?php echo __td('Tag', TD_THEME_NAME); ?> : <?php echo $current_tag_name; ?> </span> </h1> </div> <?php $td_tag_description = tag_description(); if (!empty($td_tag_description)) { echo '<div class="entry-content">'; echo $td_tag_description; echo '</div>'; }
<?php _etd('You can go to the', ''); ?> <a href="<?php echo esc_url(home_url('/')); ?> "><?php _etd('HOMEPAGE', TD_THEME_NAME); ?> </a> </div> <h4 class="block-title"><span><?php echo __td('OUR LATEST POSTS', TD_THEME_NAME); ?> </span></h4> <?php $args = array('post_type' => 'post', 'showposts' => 6); query_posts($args); $td_loop_block_module = td_util::get_option('tds_404_page_layout'); //$td_loop_block_module locate_template('loop.php', true); //get_template_part('category', 'slider'); wp_reset_query(); ?> </div> </div> <!-- /.td-pb-row --> </div> <!-- /.td-container -->
<?php locate_template('parts/footer/td_footer_extra.php', true); ?> <?php dynamic_sidebar('Footer 1'); ?> </div> <div class="td-pb-span4"> <?php td_util::vc_set_column_number(1); echo td_global_blocks::get_instance('td_block_7')->render(array('custom_title' => __td('POPULAR POSTS', TD_THEME_NAME), 'limit' => 3, 'sort' => 'popular')); ?> <?php dynamic_sidebar('Footer 2'); ?> </div> <div class="td-pb-span4"> <?php td_util::vc_set_column_number(1); echo td_global_blocks::get_instance('td_block_popular_categories')->render(array('custom_title' => __td('POPULAR CATEGORIES', TD_THEME_NAME), 'limit' => 9)); ?> <?php dynamic_sidebar('Footer 3'); ?> </div> </div> </div> </div>
<input class="td-login-input" type="text" name="login_email" id="login_email" placeholder="' . __td('your username', TD_THEME_NAME) . '" value="" required> <input class="td-login-input" type="password" name="login_pass" id="login_pass" value="" placeholder="' . __td('your password', TD_THEME_NAME) . '" required> <input type="button" name="login_button" id="login_button" class="wpb_button btn td-login-button" value="' . __td('Log In', TD_THEME_NAME) . '"> <div class="td-login-info-text"><a href="#" id="forgot-pass-link">' . __td('Forgot your password?', TD_THEME_NAME) . '</a></div> </div> ' . $users_can_register_form . ' <div id="td-forgot-pass-div" class="td-dispaly-none"> <div class="td-login-panel-title">' . __td('Recover your password', TD_THEME_NAME) . '</div> <input class="td-login-input" type="text" name="forgot_email" id="forgot_email" placeholder="' . __td('your email', TD_THEME_NAME) . '" value="" required> <input type="button" name="forgot_button" id="forgot_button" class="wpb_button btn td-login-button" value="' . __td('Send My Pass', TD_THEME_NAME) . '"> </div> </div> </div> '; } } //end login window if (td_util::get_option('tds_top_menu') != 'hide') { //shows top menu wp_nav_menu(array('theme_location' => 'top-menu', 'menu_class' => 'top-header-menu', 'fallback_cb' => 'td_wp_top_menu', 'container_class' => 'menu-top-container')); //if no top menu is set show link to create new menu
echo get_avatar($part_cur_auth_obj->user_email, '96'); ?> <div class="desc"> <div class="td-author-counters"> <span class="td-author-post-count"> <?php echo count_user_posts($part_cur_auth_obj->ID) . ' ' . __td('POSTS', TD_THEME_NAME); ?> </span> <span class="td-author-comments-count"> <?php $comment_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) AS total FROM {$wpdb->comments} WHERE comment_approved = 1 AND user_id = %d", $part_cur_auth_obj->ID)); echo $comment_count . ' ' . __td('COMMENTS', TD_THEME_NAME); ?> </span> </div> <?php if (!empty($part_cur_auth_obj->user_url)) { echo '<div class="td-author-url"><a href="' . esc_url($part_cur_auth_obj->user_url) . '">' . esc_url($part_cur_auth_obj->user_url) . '</a></div>'; } echo esc_html($part_cur_auth_obj->description); ?> <div class="td-author-social">
function get_next_prev_posts() { if (!$this->is_single) { return; } if (td_util::get_option('tds_show_next_prev') == 'hide') { return; } $buffy = ''; $next_post = get_next_post(); $prev_post = get_previous_post(); if (!empty($next_post) or !empty($prev_post)) { $buffy .= '<div class="td-block-row td-post-next-prev">'; if (!empty($prev_post)) { $buffy .= '<div class="td-block-span6 td-post-prev-post">'; $buffy .= '<div class="td-post-next-prev-content"><span>' . __td('Previous article', TD_THEME_NAME) . '</span>'; $buffy .= '<a href="' . esc_url(get_permalink($prev_post->ID)) . '">' . $prev_post->post_title . '</a>'; $buffy .= '</div>'; $buffy .= '</div>'; } else { $buffy .= '<div class="td-block-span6 td-post-prev-post">'; $buffy .= '</div>'; } $buffy .= '<div class="td-next-prev-separator"></div>'; if (!empty($next_post)) { $buffy .= '<div class="td-block-span6 td-post-next-post">'; $buffy .= '<div class="td-post-next-prev-content"><span>' . __td('Next article', TD_THEME_NAME) . '</span>'; $buffy .= '<a href="' . esc_url(get_permalink($next_post->ID)) . '">' . $next_post->post_title . '</a>'; $buffy .= '</div>'; $buffy .= '</div>'; } $buffy .= '</div>'; //end fluid row } return $buffy; }
/** * handles the ajax request from modal window for: Register */ function td_mod_remember_pass() { global $post; //json predifined return text $json_fail = json_encode(array('remember_pass', 0, __td('Email address not found!', TD_THEME_NAME))); //get the email address from ajax() call $remember_email = ''; if (!empty($_POST['email'])) { $remember_email = $_POST['email']; } if (td_login::recover_password($remember_email)) { die(json_encode(array('remember_pass', 1, __td('Your password is reset, check your email.', TD_THEME_NAME)))); } else { die($json_fail); } }
/** * renders the filter of the block * @return string */ function get_pull_down_filter() { $buffy = ''; if (empty($this->template_data_array['td_pull_down_items'])) { return ''; } //generate unique id for this pull down filter control $pull_down_wrapper_id = "td_pulldown_" . $this->template_data_array['block_uid']; // wrapper $buffy .= '<div class="td-subcat-filter" id="' . $pull_down_wrapper_id . '">'; // subcategory list $buffy .= '<ul class="td-subcat-list" id="' . $pull_down_wrapper_id . '_list">'; foreach ($this->template_data_array['td_pull_down_items'] as $item) { $buffy .= '<li class="td-subcat-item"><a class="td-subcat-link" id="' . td_global::td_generate_unique_id() . '" data-td_filter_value="' . $item['id'] . '" data-td_block_id="' . $this->template_data_array['block_uid'] . '" href="#">' . $item['name'] . '</a></li>'; } $buffy .= '</ul>'; // subcategory dropdown list $buffy .= '<div class="td-subcat-dropdown">'; $buffy .= '<div class="td-subcat-more" aria-haspopup="true"><span>' . __td('More', TD_THEME_NAME) . '</span><i class="td-icon-read-down"></i></div>'; // the dropdown list $buffy .= '<ul class="td-pulldown-filter-list">'; $buffy .= '</ul>'; $buffy .= '</div>'; $buffy .= '</div>'; return $buffy; /* $buffy = ''; if (empty($this->template_data_array['td_pull_down_items'])) { return ''; } //generate unique id for this pull down filter control $pull_down_wrapper_id = "td_pulldown_" . $this->template_data_array['block_uid']; $buffy .= '<div class="td-wrapper-pulldown-filter" id="' . $pull_down_wrapper_id . '">'; $buffy .= '<div class="td-pulldown-filter-display-option" id="' . $pull_down_wrapper_id . '_display" data-td_block_id="' . $this->template_data_array['block_uid'] . '">'; //show the default display valuea $buffy .= '<div id="td-pulldown-' . $this->template_data_array['block_uid'] . '-val"><span>'; $buffy .= $this->template_data_array['td_pull_down_items'][0]['name'] . ' </span><i class="td-icon-menu-down"></i>'; $buffy .= '</div>'; //builde the dropdown $buffy .= '<ul class="td-pulldown-filter-list" id="' . $pull_down_wrapper_id . '_list">'; foreach ($this->template_data_array['td_pull_down_items'] as $item) { $buffy .= '<li class="td-pulldown-filter-item"><a class="td-pulldown-filter-link" id="' . td_global::td_generate_unique_id() . '" data-td_filter_value="' . $item['id'] . '" data-td_block_id="' . $this->template_data_array['block_uid'] . '" href="#">' . $item['name'] . '</a></li>'; } $buffy .= '</ul>'; $buffy .= '</div>'; // /.td-pulldown-filter-display-option $buffy .= '</div>'; return $buffy; */ }
/** * @param string $output - is empty !!! * @param $atts * @param bool $content * @return mixed */ function td_gallery_shortcode($output = '', $atts, $content = false) { $buffy = ''; //check for gallery = slide if (!empty($atts) and !empty($atts['td_select_gallery_slide']) and $atts['td_select_gallery_slide'] == 'slide') { $td_double_slider2_no_js_limit = 7; $td_nr_columns_slide = 'td-slide-on-2-columns'; $nr_title_chars = 95; //check to see if we have or not sidebar on the page, to set the small images when need to show them on center if (td_global::$cur_single_template_sidebar_pos == 'no_sidebar') { $td_double_slider2_no_js_limit = 11; $td_nr_columns_slide = 'td-slide-on-3-columns'; $nr_title_chars = 170; } $title_slide = ''; //check for the title if (!empty($atts['td_gallery_title_input'])) { $title_slide = $atts['td_gallery_title_input']; //check how many chars the tile have, if more then 84 then that cut it and add ... after if (mb_strlen($title_slide, 'UTF-8') > $nr_title_chars) { $title_slide = mb_substr($title_slide, 0, $nr_title_chars, 'UTF-8') . '...'; } } $slide_images_thumbs_css = ''; $slide_display_html = ''; $slide_cursor_html = ''; $image_ids = explode(',', $atts['ids']); //check to make sure we have images if (count($image_ids) == 1 and !is_numeric($image_ids[0])) { return; } $image_ids = array_map('trim', $image_ids); //trim elements of the $ids_gallery array //generate unique gallery slider id $gallery_slider_unique_id = td_global::td_generate_unique_id(); $cur_item_nr = 1; foreach ($image_ids as $image_id) { //get the info about attachment $image_attachment = td_util::attachment_get_full_info($image_id); //get images url $td_temp_image_url_80x60 = wp_get_attachment_image_src($image_id, 'td_80x60'); //for the slide - for small images slide popup $td_temp_image_url_full = $image_attachment['src']; //default big image - for magnific popup //if we are on full wight (3 columns use the default images not the resize ones) if (td_global::$cur_single_template_sidebar_pos == 'no_sidebar') { $td_temp_image_url = wp_get_attachment_image_src($image_id, 'td_1021x580'); //1021x580 images - for big slide } else { $td_temp_image_url = wp_get_attachment_image_src($image_id, 'td_0x420'); //0x420 image sizes - for big slide } //check if we have all the images if (!empty($td_temp_image_url[0]) and !empty($td_temp_image_url_80x60[0]) and !empty($td_temp_image_url_full)) { //css for display the small cursor image $slide_images_thumbs_css .= ' #' . $gallery_slider_unique_id . ' .td-doubleSlider-2 .td-item' . $cur_item_nr . ' { background: url(' . $td_temp_image_url_80x60[0] . ') 0 0 no-repeat; }'; //html for display the big image $class_post_content = ''; if (!empty($image_attachment['description']) or !empty($image_attachment['caption'])) { $class_post_content = 'td-gallery-slide-content'; } //if picture has caption & description $figcaption = ''; if (!empty($image_attachment['caption']) or !empty($image_attachment['description'])) { $figcaption = '<figcaption class = "td-slide-caption ' . $class_post_content . '">'; if (!empty($image_attachment['caption'])) { $figcaption .= '<div class = "td-gallery-slide-copywrite">' . $image_attachment['caption'] . '</div>'; } if (!empty($image_attachment['description'])) { $figcaption .= '<span>' . $image_attachment['description'] . '</span>'; } $figcaption .= '</figcaption>'; } $slide_display_html .= ' <div class = "td-slide-item td-item' . $cur_item_nr . '"> <figure class="td-slide-galery-figure td-slide-popup-gallery"> <a class="slide-gallery-image-link" href="' . $td_temp_image_url_full . '" title="' . $image_attachment['title'] . '" data-caption="' . esc_attr($image_attachment['caption'], ENT_QUOTES) . '" data-description="' . htmlentities($image_attachment['description'], ENT_QUOTES) . '"> <img src="' . $td_temp_image_url[0] . '" alt="' . htmlentities($image_attachment['alt'], ENT_QUOTES) . '"> </a> ' . $figcaption . ' </figure> </div>'; //html for display the small cursor image $slide_cursor_html .= ' <div class = "td-button td-item' . $cur_item_nr . '"> <div class = "td-border"></div> </div>'; $cur_item_nr++; } //end check for images } //end foreach //check if we have html code for the slider if (!empty($slide_display_html) and !empty($slide_cursor_html)) { //get the number of slides $nr_of_slides = count($image_ids); if ($nr_of_slides < 0) { $nr_of_slides = 0; } $buffy = ' <style type="text/css"> ' . $slide_images_thumbs_css . ' </style> <div id="' . $gallery_slider_unique_id . '" class="' . $td_nr_columns_slide . '"> <div class="post_td_gallery"> <div class="td-gallery-slide-top"> <div class="td-gallery-title">' . $title_slide . '</div> <div class="td-gallery-controls-wrapper"> <div class="td-gallery-slide-count"><span class="td-gallery-slide-item-focus">1</span> ' . __td('of', TD_THEME_NAME) . ' ' . $nr_of_slides . '</div> <div class="td-gallery-slide-prev-next-but"> <i class = "td-icon-left doubleSliderPrevButton"></i> <i class = "td-icon-right doubleSliderNextButton"></i> </div> </div> </div> <div class = "td-doubleSlider-1 "> <div class = "td-slider"> ' . $slide_display_html . ' </div> </div> <div class = "td-doubleSlider-2"> <div class = "td-slider"> ' . $slide_cursor_html . ' </div> </div> </div> </div> '; $slide_javascript = ' //total number of slides var ' . $gallery_slider_unique_id . '_nr_of_slides = ' . $nr_of_slides . '; jQuery(document).ready(function() { //magnific popup jQuery("#' . $gallery_slider_unique_id . ' .td-slide-popup-gallery").magnificPopup({ delegate: "a", type: "image", tLoading: "Loading image #%curr%...", mainClass: "mfp-img-mobile", gallery: { enabled: true, navigateByImgClick: true, preload: [0,1], tCounter: \'%curr% ' . __td('of', TD_THEME_NAME) . ' %total%\' }, image: { tError: "<a href=\'%url%\'>The image #%curr%</a> could not be loaded.", titleSrc: function(item) {//console.log(item.el); //alert(jQuery(item.el).data("caption")); return item.el.attr("data-caption") + "<div>" + item.el.attr("data-description") + "<div>"; } }, zoom: { enabled: true, duration: 300, opener: function(element) { return element.find("img"); } }, callbacks: { change: function() { // Will fire when popup is closed jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-1").iosSlider("goToSlide", this.currItem.index + 1 ); } } }); jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-1").iosSlider({ scrollbar: true, snapToChildren: true, desktopClickDrag: true, infiniteSlider: true, responsiveSlides: true, navPrevSelector: jQuery("#' . $gallery_slider_unique_id . ' .doubleSliderPrevButton"), navNextSelector: jQuery("#' . $gallery_slider_unique_id . ' .doubleSliderNextButton"), scrollbarHeight: "2", scrollbarBorderRadius: "0", scrollbarOpacity: "0.5", onSliderResize: td_gallery_resize_update_vars_' . $gallery_slider_unique_id . ', onSliderLoaded: doubleSlider2Load_' . $gallery_slider_unique_id . ', onSlideChange: doubleSlider2Load_' . $gallery_slider_unique_id . ', keyboardControls:true }); //small image slide jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-2 .td-button").each(function(i) { jQuery(this).bind("click", function() { jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-1").iosSlider("goToSlide", i+1); }); }); //check the number of slides if(' . $gallery_slider_unique_id . '_nr_of_slides > ' . $td_double_slider2_no_js_limit . ') { jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-2").iosSlider({ desktopClickDrag: true, snapToChildren: true, snapSlideCenter: true, infiniteSlider: true }); } else { jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-2").addClass("td_center_slide2"); } function doubleSlider2Load_' . $gallery_slider_unique_id . '(args) { //var currentSlide = args.currentSlideNumber; jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-2").iosSlider("goToSlide", args.currentSlideNumber); //put a transparent border around all small sliders jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-2 .td-button .td-border").css("border", "3px solid #ffffff").css("opacity", "0.5"); jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-2 .td-button").css("border", "0"); //put a white border around the focused small slide jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-2 .td-button:eq(" + (args.currentSlideNumber-1) + ") .td-border").css("border", "3px solid #ffffff").css("opacity", "1"); //jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-2 .td-button:eq(" + (args.currentSlideNumber-1) + ")").css("border", "3px solid #ffffff"); //write the current slide number td_gallery_write_current_slide_' . $gallery_slider_unique_id . '(args.currentSlideNumber); } //writes the current slider beside to prev and next buttons function td_gallery_write_current_slide_' . $gallery_slider_unique_id . '(slide_nr) { jQuery("#' . $gallery_slider_unique_id . ' .td-gallery-slide-item-focus").html(slide_nr); } /* * Resize the iosSlider when the page is resided (fixes bug on Android devices) */ function td_gallery_resize_update_vars_' . $gallery_slider_unique_id . '(args) { if(tdDetect.isAndroid) { setTimeout(function(){ jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-1").iosSlider("update"); }, 1500); } } });'; td_js_buffer::add_to_footer($slide_javascript); } //end check if we have html code for the slider } //end if slide //!!!!!! WARNING //$return has to be != empty to overwride the default output return $buffy; }
/** * Search * * @package bbPress * @subpackage Theme */ ?> <div class="bbp-search-wrap"> <form id="bbp-search-form" role="search" method="get" class="td-search-form-widget" action="<?php bbp_search_url(); ?> "> <div> <input class="td-widget-search-input" type="text" placeholder="<?php echo __td('Search the forum'); ?> " name="bbp_search"><input class="wpb_button wpb_btn-inverse btn" type="submit" id="bbp_search_submit" value="<?php echo __td('Search'); ?> "> </div> </form> </div>
/** * the breadcrumb generator * @param $breadcrumbs_array - breadcrumbs array * @return string */ static function get_breadcrumbs($breadcrumbs_array) { global $post; if (empty($breadcrumbs_array)) { return ''; } // add home breadcrumb if the theme is configured to show it if (td_util::get_option('tds_breadcrumbs_show_home') != 'hide') { array_unshift($breadcrumbs_array, array('title_attribute' => '', 'url' => esc_url(home_url('/')), 'display_name' => __td('Home', TD_THEME_NAME))); } $buffy = ''; $buffy .= '<div class="entry-crumbs">'; foreach ($breadcrumbs_array as $key => $breadcrumb) { if (empty($breadcrumb['url'])) { if ($key != 0) { //add separator only after first $buffy .= ' <i class="td-icon-right td-bread-sep td-bred-no-url-last"></i> '; } //no link - breadcrumb $buffy .= '<span class="td-bred-no-url-last" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">'; $buffy .= '<meta itemprop="title" content = "' . $breadcrumb['display_name'] . '">'; $buffy .= '<meta itemprop="url" content = "' . get_permalink() . '">'; $buffy .= $breadcrumb['display_name']; $buffy .= '</span>'; } else { if ($key != 0) { //add separator only after first $buffy .= ' <i class="td-icon-right td-bread-sep"></i> '; } //normal links $buffy .= '<span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a title="' . $breadcrumb['title_attribute'] . '" class="entry-crumb" itemprop="url" href="' . $breadcrumb['url'] . '"><span itemprop="title">' . $breadcrumb['display_name'] . '</span></a></span>'; } } $buffy .= '</div>'; return $buffy; }
get_header(); //set the template id, used to get the template specific settings $template_id = 'search'; //prepare the loop variables global $loop_module_id, $loop_sidebar_position; /* after */ $loop_module_id = td_util::get_option('tds_' . $template_id . '_page_layout', 16); //module 16 is default $loop_sidebar_position = td_util::get_option('tds_' . $template_id . '_sidebar_pos'); //sidebar right is default (empty) // sidebar position used to align the breadcrumb on sidebar left + sidebar first on mobile issue $td_sidebar_position = ''; if ($loop_sidebar_position == 'sidebar_left') { $td_sidebar_position = 'td-sidebar-left'; } td_global::$custom_no_posts_message = __td('No results for your search', TD_THEME_NAME); ?> <div class="td-main-content-wrap"> <div class="td-container <?php echo $td_sidebar_position; ?> "> <div class="td-crumb-container"> <?php echo td_page_generator::get_search_breadcrumbs(); ?> </div> <div class="td-pb-row"> <?php switch ($loop_sidebar_position) {
$td_homepage_loop_filter = get_post_meta($post->ID, 'td_homepage_loop_filter', true); //it's send to td_data_source $td_homepage_loop = get_post_meta($post->ID, 'td_homepage_loop', true); if (!empty($td_homepage_loop['td_layout'])) { $loop_module_id = $td_homepage_loop['td_layout']; } if (!empty($td_homepage_loop['td_sidebar_position'])) { $loop_sidebar_position = $td_homepage_loop['td_sidebar_position']; } if (!empty($td_homepage_loop['td_sidebar'])) { td_global::$load_sidebar_from_template = $td_homepage_loop['td_sidebar']; } if (!empty($td_homepage_loop['list_custom_title'])) { $td_list_custom_title = $td_homepage_loop['list_custom_title']; } else { $td_list_custom_title = __td('LATEST ARTICLES'); } if (!empty($td_homepage_loop['list_custom_title_show'])) { $list_custom_title_show = false; } //adds the filters for templates: 'Homepage - with article list' and 'Homepage - bg + article list' //include_once('includes/wp_booster/td_homepage_loop_filter.php'); } /* big slide ---------------------------------------------------------------------------------------- */ locate_template('parts/page-homepage-slider.php', true); echo td_page_generator::wrap_no_row_start(); /* the content if we have one ---------------------------------------------------------------------------------------- */