Tagged: x
-
AuthorPosts
-
June 25, 2016 at 7:04 am #1059183
socialupParticipantAh wait, we found the instagram camp in the profile now! It just isn’t showing in the author box π Tried both using just the username and the full link (http://instagram.com/username)
June 25, 2016 at 7:11 am #1059194
socialupParticipantSORRY again, thanks so much. The .php file wasn’t saving but now it works perfectly! <3 You guys are the best.
June 25, 2016 at 7:34 am #1059206
ChristopherModeratorGlad to hear that we were able to help you with this.
June 25, 2016 at 9:36 am #1059286
socialupParticipantI’m so sorry to have to bug you guys again with this!
1. It was just pointed out to me that although it shows the instagram link, the facebook icon is used π (attached photo)
2. By any chance can we also add LinkedIn? On top of this code in the functions.php:// Register User Contact Methods function custom_user_contact_methods( $user_contact_method ) { $user_contact_method['linkedin'] = __( '', 'text_domain' ); return $user_contact_method; } add_filter( 'user_contactmethods', 'custom_user_contact_methods' );What would we need to add to have the LinkedIn URL (and proper icon) show in the Author Box?
June 25, 2016 at 4:35 pm #1059484
RadModeratorHi there,
Please update your code to this,
function x_shortcode_author_v2( $atts ) { extract( shortcode_atts( array( 'id' => '', 'class' => '', 'style' => '', 'title' => '', 'author_id' => '' ), $atts, 'x_author' ) ); $id = ( $id != '' ) ? 'id="' . esc_attr( $id ) . '"' : ''; $class = ( $class != '' ) ? 'x-author-box cf ' . esc_attr( $class ) : 'x-author-box cf'; $style = ( $style != '' ) ? 'style="' . $style . '"' : ''; $title = ( $title != '' ) ? $title : __( 'About the Author', csl18n() ); $author_id = ( $author_id != '' ) ? $author_id : get_the_author_meta( 'ID' ); $description = get_the_author_meta( 'description', $author_id ); $display_name = get_the_author_meta( 'display_name', $author_id ); $facebook = get_the_author_meta( 'facebook', $author_id ); $twitter = get_the_author_meta( 'twitter', $author_id ); $googleplus = get_the_author_meta( 'googleplus', $author_id ); $instagram = get_the_author_meta( 'instagram', $author_id ); $linkedin = get_the_author_meta( 'linkedin', $author_id ); $author_url = get_author_posts_url( $author_id ); $facebook_output = ( $facebook ) ? "<a href=\"{$facebook}\" class=\"x-author-social\" title=\"Visit the Facebook Profile for {$display_name}\" target=\"_blank\"><i class=\"x-icon-facebook-square\" data-x-icon=\"ο\"></i> Facebook</a>" : ''; $twitter_output = ( $twitter ) ? "<a href=\"{$twitter}\" class=\"x-author-social\" title=\"Visit the Twitter Profile for {$display_name}\" target=\"_blank\"><i class=\"x-icon-twitter-square\" data-x-icon=\"ο\"></i> Twitter</a>" : ''; $googleplus_output = ( $googleplus ) ? "<a href=\"{$googleplus}\" class=\"x-author-social\" title=\"Visit the Google+ Profile for {$display_name}\" target=\"_blank\"><i class=\"x-icon-google-plus-square\" data-x-icon=\"ο\"></i> Google+</a>" : ''; $instagram_output = ( $instagram ) ? "<a href=\"{$instagram}\" class=\"x-author-social\" title=\"Visit the Instagram Profile for {$display_name}\" target=\"_blank\"><i class=\"x-icon-instagram-square\" data-x-icon=\"\"></i> Instagram</a>" : ''; $linkedin_output = ( $linkedin ) ? "<a href=\"{$linkedin}\" class=\"x-author-social\" title=\"Visit the Instagram Profile for {$display_name}\" target=\"_blank\"><i class=\"x-icon-linkedin-square\" data-x-icon=\"\"></i> LinkedIn</a>" : ''; $output = "<div {$id} class=\"{$class}\" {$style}>" . "<h6 class=\"h-about-the-author\">{$title}</h6>" . get_avatar( $author_id, 180 ) . '<div class="x-author-info">' . "<h4 class=\"h-author mtn\"><a href=\"{$author_url}\">{$display_name}</a></h4>" . $facebook_output . $twitter_output . $googleplus_output . $instagram_output . $linkedin_output . "<p class=\"p-author mbn\">{$description}</p>" . '</div>' . '</div>'; return $output; } function change_author_shortcode_to_v2() { remove_shortcode( 'x_author' ); remove_shortcode( 'author' ); add_shortcode( 'x_author', 'x_shortcode_author_v2' ); add_shortcode( 'author', 'x_shortcode_author_v2' ); } add_action('init', 'change_author_shortcode_to_v2'); function add_profile_instagram ( $profile_fields ) { $profile_fields['instagram'] = 'Instagram Profile'; $profile_fields['linkedin'] = 'LinkedIn Profile'; return $profile_fields; } add_filter('user_contactmethods', 'add_profile_instagram');Hope this helps.
June 25, 2016 at 6:19 pm #1059556
socialupParticipantPerfect! Thanks so much!
June 25, 2016 at 11:43 pm #1059762
Rue NelModeratorYouβre welcome!
We’re glad we were able to help you out. -
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1049424 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
