Tagged: , ,

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #22676

    To have authorship information appear in search results for the content that’s written by authors I would like to show the author next to the category and date at the top of the article, page, etc.

    Can somebody show me how?

    Thanks!

    #116781

    Open up template-blog.php and single.php and replace:

    <span class="comments"><?php comments_popup_link(__('No Comments','avisio'), __('1 Comment','avisio'), __('% Comments','avisio')); ?></span>

    with:

    <span class="comments"><?php comments_popup_link(__('No Comments','avisio'), __('1 Comment','avisio'), __('% Comments','avisio')); ?></span>
    <span class="author"><?php the_author(); ?></span>

    #116782

    Thanks. Just did Dude, but nothing changes …..

    Any ideas?

    #116783

    Hi!

    Mea culpa – I used the wrong function. It needs to be the_author instead of get_the_author. I corrected the code above :)

    Regards,

    Peter

    #116784

    Thanks Peter. This shows it.

    Unfortunately Google still does not see this info as authorship markup and thus does not show my author information in search results.

    Do you know how to get this working? Is this because there is no author page in my website? And do you know how to get this page?

    Thanks again for helping me out here.

    Regards,

    Jeroen

    #116785

    You can use the the_author_link(); if you want to add a rel attribute. The link will point to the author archive page. Use it like:

    <span class="author"><?php  the_author_link(); ?></span>

    http://codex.wordpress.org/Function_Reference/the_author_link

    #116786

    Thanks for this Peter.

    Brings up another question unfortunately: the link doesn’t work. Does it have something to do with the fact that I don’t see an author.php file in the theme?

    #116787

    Hi!

    Try the the_author_posts_link(); function instead. It seems like the_author_link() will just link to the website you entered on the user profile page.

    Regards,

    Peter

    #116788

    Works!

    Thanks!!!!

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘Author mention next to category and date in head of posts and pages’ is closed to new replies.