douhu2370 2013-07-16 19:17
浏览 27

在单个帖子上显示作者生物

I'm currently finishing up work for a client website and I want the author bio to show up on the bottom of single posts. The only thing is, I only want this section to display on the front-end of the User Bio is filled in. I am so close to getting this to work, but for some reason the in the following code isn't displaying on the front end when the bio section has copy within it.

<?php   
$author_bio     = the_author_meta('description'); 
if (!empty($author_bio)) :
?>  

<h3><?php _e('About', 'roots') ;?> <a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>"><?php the_author() ;?></a>:</h3>
<?php echo '<p>', $author_bio, '</p>'; ?>
<?php endif; ?>

Any help would be greatly appreciated. Thanks!

  • 写回答

1条回答 默认 最新

  • dsg24156 2013-07-16 19:40
    关注

    You need to replace

    $author_bio     = the_author_meta('description');
    

    with

    $author_bio     = get_the_author_meta('description'); 
    

    The function the_author_meta echo it's output instead of returning it.

    评论

报告相同问题?

悬赏问题

  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器