function sc_team_item($atts, $content = null) { if (in_shortcode_blogger()) { return ''; } extract(shortcode_atts(array("id" => "", "class" => "", "user" => "", "name" => "", "position" => "", "photo" => "", "email" => "", "socials" => ""), $atts)); global $THEMEREX_sc_team_counter, $THEMEREX_sc_team_count; $THEMEREX_sc_team_counter++; $descr = do_shortcode($content); if (!empty($user) && $user != 'none' && ($user_obj = get_user_by('login', $user)) != false) { $meta = get_user_meta($user_obj->ID); if (empty($email)) { $email = $user_obj->data->user_email; } if (empty($name)) { $name = $user_obj->data->display_name; } if (empty($position)) { $position = isset($meta['user_position'][0]) ? $meta['user_position'][0] : ''; } if (empty($descr)) { $descr = isset($meta['description'][0]) ? $meta['description'][0] : ''; } if (empty($socials)) { $socials = showUserSocialLinks(array('author_id' => $user_obj->ID, 'echo' => false, 'before' => '<li>', 'after' => '</li>')); } } else { //global $THEMEREX_user_social_list; $allowed = explode('|', $socials); $socials = ''; for ($i = 0; $i < count($allowed); $i++) { $s = explode('=', $allowed[$i]); if (!empty($s[1])) { // && array_key_exists($s[0], $THEMEREX_user_social_list)) { $img = themerex_get_socials_url($s[0]); $socials .= '<li><a href="' . $s[1] . '" class="social_icons social_' . $s[0] . ' ' . $s[0] . '" target="_blank" style="background-image: url(' . $img . ');">' . '<span style="background-image: url(' . $img . ');"></span>' . '</a></li>'; } } } if (empty($photo)) { if (!empty($email)) { $photo = get_avatar($email, 370); } } else { if ($photo > 0) { $attach = wp_get_attachment_image_src($photo, 'full'); if (isset($attach[0]) && $attach[0] != '') { $photo = $attach[0]; } } $photo = getResizedImageTag($photo, 370, 370); } if (!empty($name) && !empty($position)) { return '<div class="columns1_' . $THEMEREX_sc_team_count . (!empty($class) ? ' ' . $class : '') . '">' . '<div' . ($id ? ' id="' . $id . '"' : '') . ' class="sc_team_item sc_team_item_' . $THEMEREX_sc_team_counter . ($THEMEREX_sc_team_counter % 2 == 1 ? ' odd' : ' even') . ($THEMEREX_sc_team_counter == 1 ? ' first' : '') . '">' . '<div class="sc_team_item_avatar">' . $photo . '<div class="sc_team_item_description">' . $descr . '</div>' . '</div>' . '<div class="sc_team_item_info">' . '<h3 class="sc_team_item_title">' . $name . '</h3>' . '<div class="sc_team_item_position theme_accent2">' . $position . '</div>' . (!empty($socials) ? '<ul class="sc_team_item_socials">' . $socials . '</ul>' : '') . '</div>' . '</div>' . '</div>'; } return ''; }
echo $post_author_avatar; ?> </a></div> <h5 class="post_author_name" itemprop="name"><a href="<?php echo $post_author_url; ?> " class="theme_strong fn"><?php echo $post_author; ?> </a></h5> <div class="post_author_description" itemprop="description"><?php echo $post_author_descr; ?> </div> <div class="post_author_socials"><?php echo showUserSocialLinks(array('author_id' => $post_author_id, 'echo' => false)); ?> </div> </div> </div> <?php } //===================================== Related posts ===================================== if (get_custom_option("show_post_related") == 'yes') { $args = array('numberposts' => get_custom_option('post_related_count'), 'post_type' => is_page() ? 'page' : 'post', 'post_status' => current_user_can('read_private_pages') && current_user_can('read_private_posts') ? array('publish', 'private') : 'publish', 'post__not_in' => array($post_id)); if ($post_categories_str) { $args['category__in'] = $post_categories_ids; } if ($post_format != '' && $post_format != 'standard') { $args['tax_query'] = array(array('taxonomy' => 'post_format', 'field' => 'slug', 'terms' => 'post-format-' . $post_format)); }
?> <div class="user_links"> <ul> <li><a href="mailto:<?php echo $post_author_email; ?> " data-tooltip="E-mail"><span class="icon-mail"></span></a></li> <li><a href="<?php echo $post_author_url; ?> " data-tooltip="<?php echo __('Author Link', 'themrex'); ?> "><span class="icon-link"></span></a></li> <?php showUserSocialLinks(array('author_id' => $post_author_id, 'allowed' => array('twitter', 'facebook'), 'style' => 'icons', 'before' => '<li>', 'after' => '</li>')); ?> </ul> <span class="tooltip"></span> </div> </div> </div> <div class="author_bio" itemprop="description"><p><?php echo $post_author_descr; ?> </p></div> </div> </section> <?php echo !is_author() ? '<div class="sc_divider"></div>' : ''; }
<?php //===================================== Post author info ===================================== if (get_custom_option("show_post_author") == 'yes') { $post_author_email = get_the_author_meta('user_email', $post_data['post_author_id']); $post_author_avatar = get_avatar($post_author_email, 50 * min(2, max(1, get_theme_option("retina_ready")))); $post_author_descr = do_shortcode(nl2br(get_the_author_meta('description', $post_data['post_author_id']))); $post_author_socials = showUserSocialLinks(array('author_id' => $post_data['post_author_id'], 'style' => 'bg', 'before' => '<li>', 'after' => '</li>', 'echo' => false)); ?> <section class="author vcard<?php echo get_custom_option("show_post_related") == 'yes' || get_custom_option("show_post_comments") == 'yes' ? ' hrShadow' : ''; ?> " itemprop="author" itemscope itemtype="http://schema.org/Person"> <h2 class="post_author_title"><?php echo __('About author', 'themerex'); ?> <span itemprop="name"><a href="<?php echo $post_data['post_author_url']; ?> " class="fn"><?php echo $post_data['post_author']; ?> </a></span></h2> <div class="avatar"><a href="<?php echo $post_data['post_author_url']; ?> " itemprop="image"><?php echo $post_author_avatar; ?> </a></div> <div class="authorInfo" itemprop="description"><p><?php
function sc_team_item($atts, $content = null) { if (in_shortcode_blogger()) { return ''; } extract(shortcode_atts(array("id" => "", "user" => "", "name" => "", "position" => "", "photo" => "", "email" => "", "socials" => "", "border" => "no", "align" => ""), $atts)); global $THEMEREX_sc_team_counter, $THEMEREX_sc_team_columns, $THEMEREX_sc_team_style; $THEMEREX_sc_team_counter++; $style = $THEMEREX_sc_team_style; $descr = do_shortcode($content); if (!empty($user) && $user != 'none' && ($user_obj = get_user_by('login', $user)) != false) { $meta = get_user_meta($user_obj->ID); if (empty($email)) { $email = $user_obj->data->user_email; } if (empty($name)) { $name = $user_obj->data->display_name; } if (empty($position)) { $position = isset($meta['user_position'][0]) ? $meta['user_position'][0] : ''; } // if (empty($descr)) $descr = isset($meta['description'][0]) ? $meta['description'][0] : ''; if (empty($socials)) { $socials = showUserSocialLinks(array('author_id' => $user_obj->ID, 'echo' => false, 'before' => '<li>', 'after' => '</li>', 'style' => 'icons')); } } else { global $THEMEREX_user_social_list; $allowed = explode('|', $socials); $socials = ''; for ($i = 0; $i < count($allowed); $i++) { $s = explode('=', $allowed[$i]); if (!empty($s[1]) && array_key_exists($s[0], $THEMEREX_user_social_list)) { $img = get_template_directory_uri() . '/images/socials/' . $s[0] . '.png'; $socials .= '<li><a href="' . $s[1] . '" class="social_icons social_' . $s[0] . ' ' . $s[0] . '" target="_blank" style="background-image: url(' . $img . ');">' . '<span style="background-image: url(' . $img . ');"></span>' . '</a></li>'; } } } $photo_sizes = getThumbSizes(array('thumb_size' => getThumbColumns('cub', $THEMEREX_sc_team_columns), 'thumb_crop' => true, 'sidebar' => false)); if (empty($photo)) { if (!empty($email)) { $photo = get_avatar($email, $photo_sizes['w']); } } else { $photo = getResizedImageTag($photo, $photo_sizes['w'], $photo_sizes['h']); } if (!empty($name) || !empty($position)) { if ($style != '3') { return '<div class="sc_columns_item">' . '<div' . ($id ? ' id="sc_team_item_' . $id . '"' : '') . ' class="sc_team_item sc_team_item_' . $THEMEREX_sc_team_counter . ($THEMEREX_sc_team_counter % 2 == 1 ? ' odd' : ' even') . ($THEMEREX_sc_team_counter == 1 ? ' first' : '') . '">' . '<div class="sc_team_item_avatar_wrap">' . '<div class="sc_team_item_avatar ' . ($border == "yes" ? 'sc_team_item_border' : '') . '">' . $photo . '</div>' . (!empty($socials) ? '<div class="sc_team_item_socials"><ul>' . $socials . '</ul></div>' : '') . '</div>' . ($name != '' ? '<h3 class="sc_team_item_title">' . $name . '</h3>' : '') . ($position != '' ? '<div class="sc_team_item_position">' . $position . '</div>' : '') . ($descr != '' ? '<div class="sc_team_item_description">' . $descr . '</div>' : '') . '</div>' . '</div>'; } else { if ($style == '3') { if ($align == "left") { return '<div class="sc_columns_item sc_team_left" >' . '<div' . ($id ? ' id="sc_team_item_' . $id . '"' : '') . ' class="sc_team_item sc_team_item_' . $THEMEREX_sc_team_counter . ($THEMEREX_sc_team_counter % 2 == 1 ? ' odd' : ' even') . ($THEMEREX_sc_team_counter == 1 ? ' first' : '') . '">' . '<div class="sc_team_content"><div class="sc_team_middle">' . ($name != '' ? '<h3 class="sc_team_item_title">' . $name . '</h3>' : '') . ($position != '' ? '<div class="sc_team_item_position">' . $position . '</div>' : '') . ($descr != '' ? '<div class="sc_team_item_description">' . $descr . '</div>' : '') . '</div></div>' . '<div class="sc_team_item_avatar_wrap">' . '<div class="sc_team_line"></div>' . '<div class="sc_team_item_avatar ' . ($border == "yes" ? 'sc_team_item_border' : '') . '">' . $photo . '</div>' . (!empty($socials) ? '<div class="sc_team_item_socials"><ul>' . $socials . '</ul></div>' : '') . '</div>' . '<div class="sc_space_column"></div>' . '</div>' . '</div>'; } else { return '<div class="sc_columns_item">' . '<div' . ($id ? ' id="sc_team_item_' . $id . '"' : '') . ' class="sc_team_item sc_team_item_' . $THEMEREX_sc_team_counter . ($THEMEREX_sc_team_counter % 2 == 1 ? ' odd' : ' even') . ($THEMEREX_sc_team_counter == 1 ? ' first' : '') . '">' . '<div class="sc_space_column"></div>' . '<div class="sc_team_item_avatar_wrap">' . '<div class="sc_team_line"></div>' . '<div class="sc_team_item_avatar">' . $photo . '</div>' . (!empty($socials) ? '<div class="sc_team_item_socials"><ul>' . $socials . '</ul></div>' : '') . '</div>' . '<div class="sc_team_content"><div class="sc_team_middle">' . ($name != '' ? '<h3 class="sc_team_item_title">' . $name . '</h3>' : '') . ($position != '' ? '<div class="sc_team_item_position">' . $position . '</div>' : '') . ($descr != '' ? '<div class="sc_team_item_description">' . $descr . '</div>' : '') . '</div></div>' . '</div>' . '</div>'; } } } } return ''; }
function sc_team_item($atts, $content = null) { extract(shortcode_atts(array("id" => "", "user" => ""), $atts)); global $THEMEREX_sc_team_counter; $THEMEREX_sc_team_counter++; if (($user = get_user_by('login', $user)) != false) { $meta = get_user_meta($user->ID); return '<div' . ($id ? ' id="' . $id . '"' : '') . ' class="sc_team_item sc_team_item_' . $THEMEREX_sc_team_counter . ($THEMEREX_sc_team_counter % 2 == 1 ? ' odd' : ' even') . ($THEMEREX_sc_team_counter == 1 ? ' first' : '') . '">' . '<div class="sc_team_item_avatar">' . get_avatar($user->data->user_email, 370) . '</div>' . '<h3 class="sc_team_item_title theme_title">' . $user->data->display_name . '</h3>' . '<div class="sc_team_item_position theme_info">' . (isset($meta['user_position'][0]) ? $meta['user_position'][0] : '') . '</div>' . '<div class="sc_team_item_description">' . (isset($meta['description'][0]) ? nl2br($meta['description'][0]) : '') . '</div>' . '<div class="sc_team_item_social">' . showUserSocialLinks(array('author_id' => $user->ID, 'echo' => false)) . '</div>' . '</div>'; } return ''; }
$post_author_avatar = get_avatar($post_author_email, 50 * min(2, max(1, get_theme_option("retina_ready")))); $post_author_descr = do_shortcode(nl2br(get_the_author_meta('description', $post_data['post_author_id']))); $post_author_socicon = get_custom_option('show_post_author_socicon') == true; ?> <section class="author vcard" itemscope itemtype="http://schema.org/Person"> <?php if ($post_author_socicon) { ?> <div class="authorSoc socLinks"> <h3><?php _e('Share:', 'themerex'); ?> </h3> <?php showUserSocialLinks(array('author_id' => $post_data['post_author_id'])); ?> </div> <?php } ?> <div class="authorInfo"> <div class="authorAva"><a href="<?php echo esc_url($post_data['post_author_url']); ?> " itemprop="image"><?php echo balanceTags($post_author_avatar); ?> </a></div> <div class="authorTitle hoverUnderline"><?php