function render($atts) { extract(shortcode_atts(array('icon_style' => '1', 'icon_size' => '32', 'open_in_new_window' => '', 'custom_title' => '', 'header_color' => ''), $atts)); if (empty($open_in_new_window)) { $open_in_new_window = false; } else { $open_in_new_window = true; } $buffy = ''; $buffy .= '<div class="td_block_wrap td-social-wrap td-social-wrap-' . $icon_size . '">'; $buffy .= $this->get_block_title_raw($atts); $buffy .= '<div class="td_mod_wrap">'; foreach (td_social_icons::$td_social_icons_array as $td_social_id => $td_social_name) { if (!empty($atts[$td_social_id])) { $buffy .= td_social_icons::get_icon($atts[$td_social_id], $td_social_id, $icon_style, $icon_size, $open_in_new_window); //echo $td_social_name . ' - ' . $td_social_id; } } $buffy .= '</div>'; $buffy .= '</div>'; return $buffy; }
function get_author_box($author_id = '') { if (!$this->is_single) { return; } if (td_util::get_option('tds_show_author_box') == 'hide') { $buffy = '<div class="td-author-name vcard author" style="display: none"><span class="fn">'; $buffy .= '<a href="' . get_author_posts_url($author_id) . '">' . get_the_author_meta('display_name', $author_id) . '</a>'; $buffy .= '</span></div>'; return $buffy; } if (empty($author_id)) { $author_id = $this->post->post_author; } $buffy = ''; $authorDescription = get_the_author_meta('description'); $hideAuthor = td_util::get_option('hide_author'); if (empty($hideAuthor)) { $buffy .= '<div class="author-box-wrap">'; $buffy .= '<a itemprop="author" href="' . get_author_posts_url($author_id) . '">'; $buffy .= get_avatar(get_the_author_meta('email', $author_id), '96'); $buffy .= '</a>'; $buffy .= '<div class="desc">'; $buffy .= '<div class="td-author-name vcard author"><span class="fn">'; $buffy .= '<a itemprop="author" href="' . get_author_posts_url($author_id) . '">' . get_the_author_meta('display_name', $author_id) . '</a>'; $buffy .= '</span></div>'; if (get_the_author_meta('user_url', $author_id) != '') { $buffy .= '<div class="td-author-url"><a href="' . get_the_author_meta('user_url', $author_id) . '">' . get_the_author_meta('user_url', $author_id) . '</a></div>'; } $buffy .= '<div class="td-author-description">'; $buffy .= get_the_author_meta('description', $author_id); $buffy .= '</div>'; $buffy .= '<div class="td-author-social">'; foreach (td_social_icons::$td_social_icons_array as $td_social_id => $td_social_name) { //echo get_the_author_meta($td_social_id) . '<br>'; $authorMeta = get_the_author_meta($td_social_id); if (!empty($authorMeta)) { //the theme can use the twitter id instead of the full url. This avoids problems with yoast plugin if ($td_social_id == 'twitter') { if (filter_var($authorMeta, FILTER_VALIDATE_URL)) { } else { $authorMeta = str_replace('@', '', $authorMeta); $authorMeta = 'http://twitter.com/' . $authorMeta; } } $buffy .= td_social_icons::get_icon($authorMeta, $td_social_id, 4, 16); } } $buffy .= '</div>'; $buffy .= '<div class="clearfix"></div>'; $buffy .= '</div>'; ////desc $buffy .= '</div>'; //author-box-wrap } return $buffy; }
$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"> <?php foreach (td_social_icons::$td_social_icons_array as $td_social_id => $td_social_name) { //echo get_the_author_meta($td_social_id) . '<br>'; $authorMeta = get_the_author_meta($td_social_id, $part_cur_auth_obj->ID); if (!empty($authorMeta)) { echo td_social_icons::get_icon($authorMeta, $td_social_id, 4, 16); } } ?> </div> </div> <div class="clearfix"></div> </div>
<?php /** * Created by PhpStorm. * User: ra * Date: 4/22/14 * Time: 10:07 AM */ //check to see if we show the socials from our theme or from wordpress if (td_util::get_option('td_social_networks_show') == 'show') { ?> <div class="td-header-sp-top-widget"> <?php //get the socials that are set by user $td_get_social_network = td_util::get_option('td_social_networks'); if (!empty($td_get_social_network)) { foreach ($td_get_social_network as $social_id => $social_link) { if (!empty($social_link)) { echo td_social_icons::get_icon($social_link, $social_id, 4, 16, true); } } } ?> </div> <?php }
} else { $buffy .= '<a href="' . esc_url(home_url('/')) . '"><img class="td-retina-data" src="' . $td_top_logo . '" data-retina="' . esc_attr($td_top_retina_logo) . '" alt=""/></a>'; } } $buffy .= '</aside></div>'; // column 2 description $buffy .= '<div class="' . $td_social_enabled . '"><aside class="footer-text-wrap">'; $buffy .= '<div class="block-title"><span>' . __td('ABOUT US', TD_THEME_NAME) . '</span></div>'; $buffy .= stripcslashes($td_footer_text); if (!empty($td_footer_email)) { $buffy .= '<div class="footer-email-wrap">'; $buffy .= __td('Contact us', TD_THEME_NAME) . ': <a href="mailto:' . $td_footer_email . '">' . $td_footer_email . '</a>'; $buffy .= '</div>'; } $buffy .= '</aside></div>'; // column 3 social icons if (td_util::get_option('tds_footer_social') != 'no') { $buffy .= '<div class="td-pb-span4"><aside class="footer-social-wrap td-social-style-2">'; $buffy .= '<div class="block-title"><span>' . __td('FOLLOW US', TD_THEME_NAME) . '</span></div>'; //get the socials that are set by user $td_get_social_network = td_util::get_option('td_social_networks'); if (!empty($td_get_social_network)) { foreach ($td_get_social_network as $social_id => $social_link) { if (!empty($social_link)) { $buffy .= td_social_icons::get_icon($social_link, $social_id, 4, 16, true); } } } $buffy .= '</aside></div>'; } echo $buffy;