Home › Forums › WoodMart support forum › Single Author page show social media
Single Author page show social media
- This topic has 5 replies, 2 voices, and was last updated 10 months, 3 weeks ago by Hung Pham.
-
AuthorPosts
-
January 6, 2024 at 2:42 pm #527525
696.kishanmakwanaParticipantSingle Author page how to show social media icons i have add social media but not show in author page.
Link:- https://goedmedicine.com/author/florencio-lee/January 8, 2024 at 5:17 pm #527970
Hung PhamKeymasterHi 696.kishanmakwana,
Thanks for reaching to us and I am appreciate your patience.
Unfortunately, there is no such option in our theme by default.
Regards,
January 9, 2024 at 1:42 pm #528243
696.kishanmakwanaParticipantany solutions show we have add show all social media in author page
https://goedmedicine.com/author/florencio-lee/January 10, 2024 at 11:40 am #528582
Hung PhamKeymasterHi 696.kishanmakwana,
As I replied earlier.
Unfortunately, there is no such option in our theme by default.
Regards,
January 27, 2024 at 12:33 pm #534078
696.kishanmakwanaParticipanti have fixed this issue using custome code.
Link: https://goedmedicine.com/author/florencio-lee/
Code:// Add Custom Social media icon (Instagram, Facebook, Twitter, and Email) function woodmart_author_social_media_links() { $author_id = get_the_author_meta('ID'); // Social media keys with corresponding Font Awesome icons $social_media_keys = array( 'twitter' => 'fab fa-twitter', 'facebook' => 'fab fa-facebook-f', 'instagram' => 'fab fa-instagram', 'gmail' => 'fas fa-envelope', // Use a general email icon for Gmail // Add more social media keys as needed ); echo '<div class="author-social-media">'; foreach ($social_media_keys as $social_media_key => $icon_class) { $social_media_url = ''; if ($social_media_key === 'gmail') { // Get the current user's email $current_user_email = get_the_author_meta('user_email', $author_id); $social_media_url = 'mailto:' . esc_attr($current_user_email); } elseif (in_array($social_media_key, array('facebook', 'twitter'))) { // For Facebook and Twitter, assume the user profile fields have the corresponding URLs $social_media_url = get_the_author_meta($social_media_key, $author_id); } elseif ($social_media_key === 'instagram') { // For Instagram, assume the user profile field has the corresponding URL $social_media_url = get_the_author_meta('instagram_url', $author_id); } if (!empty($social_media_url)) { echo '<a href="' . esc_url($social_media_url) . '" target="_blank" rel="nofollow">'; echo '<i class="' . esc_attr($icon_class) . '" aria-hidden="true"></i>'; echo '</a>'; } } echo '</div>'; } // Add the social media links to the author bio add_action('woodmart_author_social_media', 'woodmart_author_social_media_links');
Close ticket
January 28, 2024 at 6:54 am #534229
Hung PhamKeymasterHi 696.kishanmakwana,
Glad to hear your issue has been resolved. Keep us in mind for future questions and concerns, we’re always here to help!
Regards,
-
AuthorPosts
Tagged: author
The topic ‘Single Author page show social media’ is closed to new replies.
- You must be logged in to create new topics. Login / Register