This is a very simple PHP issue, unrelated to WordPress. You need to check if the value is empty before echo
ing it. So, store them as variables first:
$twitter = get_the_author_meta('twitter', $author_id);
$facebook = get_the_author_meta('facebook', $author_id);
//etc
Then check them before displaying:
if(!empty($twitter)) {
echo '<a title="Follow me on Twitter" href="'.$twitter.'"><img src="twitter.png" alt="" /></a>';
}
if(!empty($facebook)) {
echo '<a title="Follow me on Facebook" href="'.$facebook.'"><img src="facebook.png" alt="" /></a>';
}
//etc
Related Posts:
- Add admin bar link to edit author
- Limit the length of the Author Profile Biographical Text
- List repeating share links
- Hide Author.php template from specific user role
- what function can I use to automatically output og tags per page/post?
- Skeleton Child Theme Add Icon Bar to Header Flex Grid
- Author social media aren’t shown on the page
- Is it ok to use a function to output the text domain name in a wordpress theme
- How to override a function when isn’t at functions.php
- contactform7 remove tags with “wpcf7_autop false” from functions.php
- How to count number of functions attached to an action hook?
- Show modified time if post is actually modified
- ajax live search for post title
- Hourly Routine Not Firing ( wp_schedule_event() )
- How to get an array of menu items from the toolbar?
- Using get_terms for custom taxonomy in functions.php
- Fatal error: Call to undefined function add_action() – an untouched problem
- echo or print_r in an admin function
- Editing or filtering the output of the Genesis navigation
- Automatically Add Specified Value to Attachment Metadata upon Upload
- Twenty Eleven Child theme error when attempting to use a rewritten function
- echo get_post_meta()
- Replace menu links with # and add name to its li
- Retrieve tags data in post body
- Remove H1 / title / Underscore – without CSS
- Custom Static Links For Specific Menu Right Before/Next The wp_nav_menu Function now working
- Change template on the fly based on post parent selection
- Current path on page in functions.php
- How do you publish a draft on WordPress
- How can I recompile js file in dist folder?
- Show Primary Category first when I display post categories
- Wp_query function to search from product_title ‘OR’ product tags name
- Remove the product category module block from the Woocommerce product page
- Setting youtube size in functions.php
- Redirect to another page if the user is logged in when pressing again the login button on menu bar
- wp_get_archives custom function broken since upgrading to WP 3.7.1
- Remove category from url
- ‘Attempt to modify property of non-object’ warning
- Conditional functions.php on page template
- Accessing two databases wordpress
- Optimizing a WordPress site
- different style sheet for just one page template
- Problem with comments_number()
- Functions when woocommerce isn’t installed
- How to target post and pages and not all post types in admin?
- How to get correct value from checked()?
- Dequeue script to prevent javascript event conflict on wordpress child theme
- While loop with an exception after a count is reached
- Return child theme url
- Redefine function arguments before rendering
- Enqueue script on every page except one
- Best way to handle lack of titles in microblogging
- Upgraded server now class My_Walker_Nav_Menu extends Walker_Nav_Menu not working
- Functions php shortcode for displaying main menu with no child items
- How to include any template using Shortcode fuction?
- display a div on ervery site but not frontpage?
- first paragraph of the_content as meta description
- get_terms (or tax_query) for term of current post?
- Do we need to change our child function.php to require/include child dir files when we add an over-riding file.php into the child theme
- How to use get_posts() function in functions.php
- Replace header image on all other pages but home – URL issue
- Child theme functions.php
- How to echo Widget Title in Custom Frontend-Template Box
- Redirect to post after publish or update a published post
- Page Template Won’t Load Correct CSS File
- Getting images from media library and get_the_date() not working
- WordPress show bad the php hour and date
- Using add_image_size in functions.php to get original uploaded file
- show all the posts thumbnails
- the_excerpt function not showing image
- How to display this meta data (an array) in form of a function (created with a custom write panel)?
- WordPress – using sessions?
- Use a filter for wp_robots to block CPT/feed/
- Trigger email alert if file downloaded
- Completely Disable WordPress RSS Feeds
- Order column custom date using pre_get_posts
- query_vars treat as single var from URL
- Running javascript without hooking wp_head
- Remove text after a dot and a colon in Woocommerce product title
- Selecting specific query for offset
- Enable CORS Request for hostname using IP address
- Show image after X para – center aligned
- Change default color scheme in twentyfifteen child theme?
- Restrict access if logged out except for homepage
- Add meta data in head from theme
- what is `get_section()` and how to use it?
- function replace_text for entire page
- DISABLE wordpress upgrade page
- How to echo the translated custom field?
- Only Show One Category Name Per Post
- Moving CDN jQuery to footer does not work?
- Pass max posts to Javascript
- Register a widget area when a theme option has been saved?
- Blank child theme – functions.php problem
- update_usermeta don’t work
- WP supersize not displaying when different languages flags are selected
- How do I make my child theme’s CSS update when I save it?
- Bulk set Post Title as Tag where Tag is Empty Function
- Customizer cuistom CSS Priority ordre Issue
- WPDB query suddenly not working