Example #1
0
function axiom_sc_team_item($atts, $content = null)
{
    if (axiom_sc_in_shortcode_blogger()) {
        return '';
    }
    extract(axiom_sc_html_decode(shortcode_atts(array("user" => "", "member" => "", "name" => "", "position" => "", "photo" => "", "email" => "", "link" => "", "socials" => "", "id" => "", "class" => "", "animation" => "", "css" => ""), $atts)));
    global $AXIOM_GLOBALS;
    $AXIOM_GLOBALS['sc_team_counter']++;
    $descr = trim(chop(do_shortcode($content)));
    if (!empty($socials)) {
        $socials = do_shortcode('[trx_socials socials="' . esc_attr($socials) . '"][/trx_socials]');
    }
    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 = axiom_show_user_socials(array('author_id' => $user_obj->ID, 'echo' => false));
        }
    }
    if (!empty($member) && $member != 'none' && ($member_obj = get_page_by_title($member, OBJECT, 'team')) != null) {
        if (empty($name)) {
            $name = $member_obj->post_title;
        }
        if (empty($descr)) {
            $descr = $member_obj->post_excerpt;
        }
        $post_meta = get_post_meta($member_obj->ID, 'team_data', true);
        if (empty($position)) {
            $position = $post_meta['team_member_position'];
        }
        if (empty($link)) {
            $link = !empty($post_meta['team_member_link']) ? $post_meta['team_member_link'] : get_permalink($member_obj->ID);
        }
        if (empty($email)) {
            $email = $post_meta['team_member_email'];
        }
        if (empty($photo)) {
            $photo = wp_get_attachment_url(get_post_thumbnail_id($member_obj->ID));
            if (empty($photo)) {
                if (!empty($email)) {
                    $photo = get_avatar($email, 350 * min(2, max(1, axiom_get_theme_option("retina_ready"))));
                }
            } else {
                $photo = axiom_get_resized_image_tag($photo, 350, 350);
            }
        }
        if (empty($socials)) {
            $socials = '';
            $soc_list = $post_meta['team_member_socials'];
            if (is_array($soc_list) && count($soc_list) > 0) {
                $soc_str = '';
                foreach ($soc_list as $sn => $sl) {
                    if (!empty($sl)) {
                        $soc_str .= (!empty($soc_str) ? '|' : '') . $sn . '=' . $sl;
                    }
                }
                if (!empty($soc_str)) {
                    $socials = do_shortcode('[trx_socials socials="' . esc_attr($soc_str) . '"][/trx_socials]');
                }
            }
        }
    }
    if (empty($photo)) {
        if (!empty($email)) {
            $photo = get_avatar($email, 350 * min(2, max(1, axiom_get_theme_option("retina_ready"))));
        }
    } else {
        if ($photo > 0) {
            $attach = wp_get_attachment_image_src($photo, 'full');
            if (isset($attach[0]) && $attach[0] != '') {
                $photo = $attach[0];
            }
        }
        $photo = axiom_get_resized_image_tag($photo, 350, 280);
    }
    $output = !empty($name) && !empty($position) ? '<div class="column-1_' . esc_attr($AXIOM_GLOBALS['sc_team_columns']) . (!empty($class) ? ' ' . esc_attr($class) : '') . '"' . ($css != '' ? ' style="' . esc_attr($css) . '"' : '') . (!axiom_sc_param_is_off($animation) ? ' data-animation="' . esc_attr(axiom_sc_get_animation_classes($animation)) . '"' : '') . '>' . '<div' . ($id ? ' id="' . esc_attr($id) . '"' : '') . ' class="sc_team_item sc_team_item_' . esc_attr($AXIOM_GLOBALS['sc_team_counter']) . ($AXIOM_GLOBALS['sc_team_counter'] % 2 == 1 ? ' odd' : ' even') . ($AXIOM_GLOBALS['sc_team_counter'] == 1 ? ' first' : '') . '">' . '<div class="sc_team_item_avatar">' . $photo . ($AXIOM_GLOBALS['sc_team_style'] == 2 ? '<div class="sc_team_item_hover"><div class="sc_team_item_socials">' . $socials . '</div></div>' : '') . '</div>' . '<div class="sc_team_item_info">' . '<h6 class="sc_team_item_title">' . ($link ? '<a href="' . esc_url($link) . '">' : '') . $name . ($link ? '</a>' : '') . '</h6>' . '<div class="sc_team_item_position">' . $position . '</div>' . ($AXIOM_GLOBALS['sc_team_style'] == 1 ? '<div class="sc_team_item_description">' . $descr . '</div>' . $socials : '') . '</div>' . '</div>' . '</div>' : '';
    return apply_filters('axiom_shortcode_output', $output, 'trx_team_item', $atts, $content);
}
Example #2
0
<?php

//===================================== Post author info =====================================
if (axiom_get_custom_option("show_post_author") == 'yes') {
    $post_author_name = $post_author_socials = '';
    $show_post_author_socials = true;
    if ($post_data['post_type'] == 'post') {
        $post_author_title = __('About', 'axiom');
        $post_author_name = $post_data['post_author'];
        $post_author_url = $post_data['post_author_url'];
        $post_author_email = get_the_author_meta('user_email', $post_data['post_author_id']);
        $post_author_avatar = get_avatar($post_author_email, 75 * min(2, max(1, axiom_get_theme_option("retina_ready"))));
        $post_author_descr = do_shortcode(nl2br(get_the_author_meta('description', $post_data['post_author_id'])));
        if ($show_post_author_socials) {
            $post_author_socials = axiom_show_user_socials(array('author_id' => $post_data['post_author_id'], 'style' => 'bg', 'size' => 'small', 'style' => 'icons', 'echo' => false));
        }
    }
    if (!empty($post_author_name)) {
        ?>
		<section class="post_author author vcard" itemprop="author" itemscope itemtype="http://schema.org/Person">
			<div class="post_author_avatar"><a href="<?php 
        echo esc_url($post_data['post_author_url']);
        ?>
" itemprop="image"><?php 
        echo $post_author_avatar;
        ?>
</a></div>
			<h6 class="post_author_title"><?php 
        echo esc_html($post_author_title);
        ?>
 <span itemprop="name"><a href="<?php