Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Wordpress Author Biography no longer showing up WordPress

I just noticed that the author biography on my site is no longer showing up. I'm not 100% sure but it falls in line with the update to version 3.3.

The code in single.php has not changed, but there is no output anymore on the site.


<div id="entry-author-info">
<div id="author-description"><strong>About the Author:</strong><?php the_author_meta('description') ?>
</div>
</div>


Here is a sample page: http://www.ghacks.net/2011/12/14/use-smart-defrag-for-accurate-defragmentation/

Other values, like the_author_meta('first_name') work on the site.

It is very important that I get the functionality back as soon as possible. Any help would be appreciated.

Answers (6)

2011-12-17

Francisco Javier Carazo Gil answers:

Hi Giacome,

Have you seen the DB?

Try this in your SQL client:

SELECT *
FROM wp_usermeta
WHERE meta_key LIKE('description');


Tell me which is the result.


giacome comments:

Hi, I'm getting the descriptions displayed in the database. All showing up fine.

2011-12-17

Gabriel Reguly answers:

Hi giacome,

Unfortunately functions the_author_meta and get_the_author_meta have not changed from WordPress 3.2.1 to WordPress 3.3

So it must be something else.

Are you sure the data is at the database?

Regards,
Gabriel Reguly


giacome comments:

Yes the data is there.


Gabriel Reguly comments:

Hi Giacome,

That is odd, please try this code:


<?php
global $authordata;
if ( !is_object( $authordata ) ) {
?>
<!-- Error: $authordata should be set -->
<?php
}
?>
<div id="entry-author-info">
<div id="author-description">About the Author:<?php the_author_meta('user_description', $authordata->ID ) ?></div>
</div>


If it does not bring back the Bio, then please check HTML source for the error.

Regards,
Gabriel


giacome comments:

Gabriel, the author bio and the error message are both not being displayed.


Gabriel Reguly comments:

Hi Giacome,

The error message is not to be displayed, it is an HTML comment. To see it you will need to see the HTML source.

Please try another approach, try to save the author bio to variable at the start of the page and then use it later.

Like this:

<?php get_header(); ?>
<div class="main">
<!-- google_ad_section_start -->
<!-- Begin Content Section of <?php the_title(); ?> -->
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php
$author_bio = get_the_author_meta('user_description');
?>
<div class="article">
<h1>
<?php the_title(); ?>
</h1>
<div class="content" align="left">
<div style="float:left;margin-top:0px;margin-right:4px;"> ADSENSE </div>
<?php the_content('Read the rest of this entry &raquo;'); ?>
Enjoyed the article?: Then sign-up for our <a href="http://www.ghacks.net/ghacks-newsletter/">free newsletter</a> or <a href="http://www.ghacks.net/ghacksnet-feed-list/">RSS feed</a> to kick off your day with the latest technology news and tips, or share the article
with your friends and contacts on Facebook or Twitter.<br />
<br />
<div class='social'> <a href='http://www.facebook.com/sharer.php?u=<?php the_permalink() ?>' class='social_icon facebook' rel="nofollow"></a> <a href='https://twitter.com/share?url=<?php the_permalink() ?>' class='social_icon twitter' rel="nofollow"></a> <a class='social_icon googleplus' href="https://plusone.google.com/_/+1/confirm?hl=en&url=<?php the_permalink() ?>" rel="nofollow"></a> <a href='javascript:window.print()' class='social_icon print'></a>
<div style='clear:both'></div>
</div>
<?php related_posts(); ?>
<br />
Adsense<br />
<div id="entry-author-info">
<div id="author-description">About the Author:
<?php echo $author_bio; ?>
</div>
</div>
<p class="tags">Author:
<?php the_author_posts_link(); ?>
,
<?php the_time('l F j, Y'); ?>
- <br />
<?php if ( has_tag() ) { the_tags('Tags:', ', ', ''); } else { ?>
TAGS: <a href="<?php the_permalink(); ?>">None</a>
<?php } ?>
<br />
</p>
<?php
if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb('<div id="breadcrumbs">','</div>');
}
?>
<div class="navigation">
<div class="alignleft">Previous Post:
<?php previous_post('%', '', 'yes'); ?>
</div>
<br />
<div class="alignleft">Next Post:
<?php next_post('%', '', 'yes'); ?>
</div>
<br />
Click on the following link(s) to read more about
<?php the_category(', ') ?>
</div>
<!-- end navigation -->
<br />
<div class="clr"></div>
<?php comments_template('', true); ?>
<!-- google_ad_section_end -->
</div>
</div>
<div class="clr"></div>
<?php endwhile; ?>
<div class="navigation">
<div class="alignleft">
<?php next_posts_link('&laquo; Older Entries') ?>
</div>
<div class="alignright">
<?php previous_posts_link('Newer Entries &raquo;') ?>
</div>
</div>
<?php else : ?>
<div class="article">
<ul class="extendspost">
<li>Author: <a href="<?php echo get_settings('home'); ?>">404 Master</a></li>
<li>Published: <a href="<?php echo get_settings('home'); ?>">Apr. 4, 404 BC</a></li>
<li>Category: <a href="<?php echo get_settings('home'); ?>">Can't</a>, <a href="<?php echo get_settings('home'); ?>">Find</a>, <a href="<?php echo get_settings('home'); ?>">It</a></li>
<li>Comments: <a href="<?php echo get_settings('home'); ?>">None</a></li>
</ul>
<h1>Oh no! Article not found! 404 error!</h1>
<div class="clr marginbottom"></div>
<p class="tags">TAGS: <a href="<?php echo get_settings('home'); ?>">Are</a>, <a href="<?php echo get_settings('home'); ?>">You</a>, <a href="<?php echo get_settings('home'); ?>">Lost?</a></p>
<div class="content">
<p><span class="dropcap">W</span>e regret to inform you that the article or post you were looking is nowhere to be found. We agree that this is rather unfortunate. Luckily for you, we've implemented a handy search box into the top right hand corner or perhaps you'd rather check out our <a href="<?php echo get_settings('home'); ?>">homepage</a>? I can assure you that we are hunting down this 404 bug as you read this and it will be promptly corrected, unless you purposely typed in an incorrect URL, in that case, cut it out!</p>
<p class="tags">TAGS: <a href="<?php echo get_settings('home'); ?>">Are</a>, <a href="<?php echo get_settings('home'); ?>">You</a>, <a href="<?php echo get_settings('home'); ?>">Lost?</a></p>
</div>
</div>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
<div class="clr"></div>
<?php get_footer(); ?>


If this does not work, then try with John Cotton's approach


<?php get_header(); ?>
<div class="main">
<!-- google_ad_section_start -->
<!-- Begin Content Section of <?php the_title(); ?> -->
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php
$author_meta = get_the_author_meta('user_description');
$author_bio = $author_meta['description'][0];
?>
<div class="article">
<h1>
<?php the_title(); ?>
</h1>
<div class="content" align="left">
<div style="float:left;margin-top:0px;margin-right:4px;"> ADSENSE </div>
<?php the_content('Read the rest of this entry &raquo;'); ?>
Enjoyed the article?: Then sign-up for our <a href="http://www.ghacks.net/ghacks-newsletter/">free newsletter</a> or <a href="http://www.ghacks.net/ghacksnet-feed-list/">RSS feed</a> to kick off your day with the latest technology news and tips, or share the article
with your friends and contacts on Facebook or Twitter.<br />
<br />
<div class='social'> <a href='http://www.facebook.com/sharer.php?u=<?php the_permalink() ?>' class='social_icon facebook' rel="nofollow"></a> <a href='https://twitter.com/share?url=<?php the_permalink() ?>' class='social_icon twitter' rel="nofollow"></a> <a class='social_icon googleplus' href="https://plusone.google.com/_/+1/confirm?hl=en&url=<?php the_permalink() ?>" rel="nofollow"></a> <a href='javascript:window.print()' class='social_icon print'></a>
<div style='clear:both'></div>
</div>
<?php related_posts(); ?>
<br />
Adsense<br />
<div id="entry-author-info">
<div id="author-description">About the Author:
<?php echo $author_bio; ?>
</div>
</div>
<p class="tags">Author:
<?php the_author_posts_link(); ?>
,
<?php the_time('l F j, Y'); ?>
- <br />
<?php if ( has_tag() ) { the_tags('Tags:', ', ', ''); } else { ?>
TAGS: <a href="<?php the_permalink(); ?>">None</a>
<?php } ?>
<br />
</p>
<?php
if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb('<div id="breadcrumbs">','</div>');
}
?>
<div class="navigation">
<div class="alignleft">Previous Post:
<?php previous_post('%', '', 'yes'); ?>
</div>
<br />
<div class="alignleft">Next Post:
<?php next_post('%', '', 'yes'); ?>
</div>
<br />
Click on the following link(s) to read more about
<?php the_category(', ') ?>
</div>
<!-- end navigation -->
<br />
<div class="clr"></div>
<?php comments_template('', true); ?>
<!-- google_ad_section_end -->
</div>
</div>
<div class="clr"></div>
<?php endwhile; ?>
<div class="navigation">
<div class="alignleft">
<?php next_posts_link('&laquo; Older Entries') ?>
</div>
<div class="alignright">
<?php previous_posts_link('Newer Entries &raquo;') ?>
</div>
</div>
<?php else : ?>
<div class="article">
<ul class="extendspost">
<li>Author: <a href="<?php echo get_settings('home'); ?>">404 Master</a></li>
<li>Published: <a href="<?php echo get_settings('home'); ?>">Apr. 4, 404 BC</a></li>
<li>Category: <a href="<?php echo get_settings('home'); ?>">Can't</a>, <a href="<?php echo get_settings('home'); ?>">Find</a>, <a href="<?php echo get_settings('home'); ?>">It</a></li>
<li>Comments: <a href="<?php echo get_settings('home'); ?>">None</a></li>
</ul>
<h1>Oh no! Article not found! 404 error!</h1>
<div class="clr marginbottom"></div>
<p class="tags">TAGS: <a href="<?php echo get_settings('home'); ?>">Are</a>, <a href="<?php echo get_settings('home'); ?>">You</a>, <a href="<?php echo get_settings('home'); ?>">Lost?</a></p>
<div class="content">
<p><span class="dropcap">W</span>e regret to inform you that the article or post you were looking is nowhere to be found. We agree that this is rather unfortunate. Luckily for you, we've implemented a handy search box into the top right hand corner or perhaps you'd rather check out our <a href="<?php echo get_settings('home'); ?>">homepage</a>? I can assure you that we are hunting down this 404 bug as you read this and it will be promptly corrected, unless you purposely typed in an incorrect URL, in that case, cut it out!</p>
<p class="tags">TAGS: <a href="<?php echo get_settings('home'); ?>">Are</a>, <a href="<?php echo get_settings('home'); ?>">You</a>, <a href="<?php echo get_settings('home'); ?>">Lost?</a></p>
</div>
</div>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
<div class="clr"></div>
<?php get_footer(); ?>


Good luck,
Gabriel



giacome comments:

Gabriel,

the first is not working, the second returns a php error.

2011-12-17

Manoj Raj answers:

Hi,

My question is same as the above two..

Do you see "bio" data associated with each author in the database ?


Manoj Raj comments:

Can you post the full single.php code here?

If you have the description stored in the database, try the following (Just trial-and-error)

1) Replace

<?php the_author_meta('description') ?>

with this

<?php the_author_meta( 'description', $userID ); ?>

Note: Replace $userID with the corresponding person's userid..

Check whether it is working?

What are the roles assigned to the authors?


giacome comments:

I tried that yesterday but it was not working either. The full single.php is this:

<?php get_header(); ?>
<div class="main">
<!-- google_ad_section_start -->
<!-- Begin Content Section of <?php the_title(); ?> -->
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="article">
<h1><?php the_title(); ?></h1>

<div class="content" align="left">
<div style="float:left;margin-top:0px;margin-right:4px;">
ADSENSE
</div>

<?php the_content('Read the rest of this entry &raquo;'); ?>

<strong>Enjoyed the article?</strong>: Then sign-up for our <a href="http://www.ghacks.net/ghacks-newsletter/">free newsletter</a> or <a href="http://www.ghacks.net/ghacksnet-feed-list/">RSS feed</a> to kick off your day with the latest technology news and tips, or share the article
with your friends and contacts on Facebook or Twitter.<br /><br />

<div class='social'>
<a href='http://www.facebook.com/sharer.php?u=<?php the_permalink() ?>' class='social_icon facebook' rel="nofollow"></a>
<a href='https://twitter.com/share?url=<?php the_permalink() ?>' class='social_icon twitter' rel="nofollow"></a>
<a class='social_icon googleplus' href="https://plusone.google.com/_/+1/confirm?hl=en&url=<?php the_permalink() ?>" rel="nofollow"></a>
<a href='javascript:window.print()' class='social_icon print'></a>
<div style='clear:both'></div>
</div>

<?php related_posts(); ?>
<br />
Adsense<br />


<div id="entry-author-info">
<div id="author-description"><strong>About the Author:</strong><?php the_author_meta('user_description') ?>
</div>
</div>

<p class="tags">Author: <?php the_author_posts_link(); ?>, <?php the_time('l F j, Y'); ?> - <br /><?php if ( has_tag() ) { the_tags('Tags:', ', ', ''); } else { ?><em>TAGS:</em> <a href="<?php the_permalink(); ?>">None</a><?php } ?><br /></p>

<?php if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb('<div id="breadcrumbs">','</div>');
} ?>

<div class="navigation">

<div class="alignleft">Previous Post:
<?php previous_post('%',
'', 'yes'); ?>
</div><br />
<div class="alignleft">Next Post:
<?php next_post('%',
'', 'yes'); ?>
</div>
<br />
Click on the following link(s) to read more about <?php the_category(', ') ?>
</div> <!-- end navigation --><br />
<div class="clr"></div>
<?php comments_template('', true); ?>
<!-- google_ad_section_end -->
</div></div>
<div class="clr"></div>

<?php endwhile; ?>

<div class="navigation">
<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
</div>

<?php else : ?>
<div class="article">
<ul class="extendspost">
<li>Author: <a href="<?php echo get_settings('home'); ?>">404 Master</a></li>
<li>Published: <a href="<?php echo get_settings('home'); ?>">Apr. 4, 404 BC</a></li>
<li>Category: <a href="<?php echo get_settings('home'); ?>">Can't</a>, <a href="<?php echo get_settings('home'); ?>">Find</a>, <a href="<?php echo get_settings('home'); ?>">It</a></li>
<li>Comments: <a href="<?php echo get_settings('home'); ?>">None</a></li>
</ul>
<h1>Oh no! Article not found! 404 error!</h1>
<div class="clr marginbottom"></div>
<p class="tags"><em>TAGS:</em> <a href="<?php echo get_settings('home'); ?>">Are</a>, <a href="<?php echo get_settings('home'); ?>">You</a>, <a href="<?php echo get_settings('home'); ?>">Lost?</a></p>
<div class="content">
<p><span class="dropcap">W</span>e regret to inform you that the article or post you were looking is nowhere to be found. We agree that this is rather unfortunate. Luckily for you, we've implemented a handy <em>search box</em> into the top right hand corner or perhaps you'd rather check out our <a href="<?php echo get_settings('home'); ?>">homepage</a>? I can assure you that we are hunting down this 404 bug as you read this and it will be promptly corrected, unless you purposely typed in an incorrect URL, in that case, cut it out!</p>
<p class="tags"><em>TAGS:</em> <a href="<?php echo get_settings('home'); ?>">Are</a>, <a href="<?php echo get_settings('home'); ?>">You</a>, <a href="<?php echo get_settings('home'); ?>">Lost?</a></p>
</div>
</div>
<?php endif; ?>

</div>

<?php get_sidebar(); ?>

<div class="clr"></div>

<?php get_footer(); ?>



giacome comments:

author roles are different, one is admin, some are editors.


giacome comments:

Oh, and adding the user ID is also not working.


Manoj Raj comments:

Try removing the <?php related_posts(); ?> and check whether it is working because it is the function before displaying author description..

Or add <?php
wp_reset_query(); ?> after <?php related_posts(); ?>


related_posts() -> Is this function a plugin or your own?


giacome comments:

reset query does not resolve the issue. The related posts entry is from the YARPP plugin.


Manoj Raj comments:

let us try one more thing..

<div id="entry-author-info">

<div id="author-description">About the Author:<?php the_author_meta('description') ?>

</div>

</div>


Try pasting the above code soon after

<div class="article">

Check whether it is working?


giacome comments:

This is not working.

2011-12-17

Arnav Joy answers:

try using this

<?php the_author_meta('user_description') ?>


giacome comments:

This is not working unfortunately.


Arnav Joy comments:

ok then , deactivate all of your plugins then run your code , try it.


giacome comments:

Deactivating plugins had no effect. I just checked the parameters for the command, some are working, e.g. first_name or last_name while others are not, e.g. description, user_description or user_firstname and user_lastname


Arnav Joy comments:

please try

wp_reset_query();

as follows

<?php
wp_reset_query();
the_author_meta('user_description')
// or this
the_author_meta('description')
wp_reset_query();
?>


Arnav Joy comments:

also please try in your wp-config.php

define('WP_DEBUG', true);

if it false there , may be you will get some error or any info.


Arnav Joy comments:

try this code

// get author id from this code
$author_id = get_the_author_meta('ID') ;

// if can not get author id from above method then use following method.
global $post;

$author_id = $post->post_author;


$user_info = get_userdata($author_id);
echo $description = $user_info->user_description;


Arnav Joy comments:

try these plugins:--

http://wordpress.org/extend/plugins/wp-biographia/

http://wordpress.org/extend/plugins/author-bio/

2011-12-17

John Cotton answers:

Just after this line in your single.php

<div class="article">

add this:

global $post;

$ameta = get_user_meta($post->post_author);
print_r($ameta);


Does the author description show up in that dump?


giacome comments:

Yes it does John


John Cotton comments:

In which case, it could be something grabbing the filter and blanking it out but that would be very odd. But your quick fix is to output $ameta['description'][0] in place of the author meta function.


John Cotton comments:

...then you could spend a little time tracking down whatever is wipeing out your description value...


giacome comments:

This does not work either, unfortunately. Something seems to be filtering out the description on the page.

2011-12-18

Christianto answers:

Hi,

If the ID of the author can be returned by the function (get_the_author_meta() or the_author_meta()), you can use get_userdata():
<?php
$current_author = get_userdata(get_the_author_meta('ID'));
?>
<div id="entry-author-info">
<div id="author-description">
About the Author:<?php echo $current_author->user_description; ?>
</div>
</div>


more info on[[LINK href="http://codex.wordpress.org/Function_Reference/get_userdata"]] wordpress codex page.[[/LINK]]


giacome comments:

This is not displaying anything either, unfortunately.