开发者

Wordpress author name coming twice

I am using Wordpress to create a blog. I am showing author name in the article but it is repeating. I am using the get_the_author(); function

Here is my wordpres开发者_如何学编程s site: http://hideawayharbor.org/blog/


Write get_the_author(); instead of the_author();

It will display single author.


It shows twice when you write

<?php echo the_author(); ?>

It will be

<?php the_author(); ?>


You should open up /wp-content/themes/YOURTHEME/single.php in an editor (such as Dreamweaver) and do a search on the string "Posted by"

Then check your code and you may find it's echo'ing it twice there.

You would also have to fix this in page.php, archive.php and possibly others.

Post the code you find here if you need more help.


Make sure you are not echoing the_author()

Its either

the_author()

or

echo get_the_author()


Solutions

  1. You might be accidently writing it twice?
  2. If it shows twice in all the themes then there might be something attached to the author name hook and displaying it twice
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜