WordPress.org

Forums

WordPress Popular Posts
[resolved] [Plugin: WordPress Popular Posts] Add an author link (6 posts)

  1. Jinxity
    Member
    Posted 2 years ago #

    I want to add a link on author name to author's post page. I tried with get_author_posts_url() but unsuccessfully. Maybe someone could help me ?

    http://wordpress.org/extend/plugins/wordpress-popular-posts/

  2. Hector Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Jinxity,

    It's very simple. Open wordpress-popular-posts.php and change this (around line 994):

    $display_name = get_the_author_meta('display_name', $p->uid);

    ... into this:

    $display_name = get_author_posts_url($p->uid);

    I did not test the code but it should work. If it doesn't, let me know.

  3. Jinxity
    Member
    Posted 2 years ago #

    Thank you ! It's exactly what I want :)

  4. Hector Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    Actually, just tested the code and it was wrong. It should be:

    $display_name = "<a href=\"".get_author_posts_url($p->uid)."\">{$author}</a>";

  5. Jinxity
    Member
    Posted 2 years ago #

    I had changed the code to have this result but your code is better than what I wrote. Thanks you for your help (I think you can add this on your plugin, it's could interest people)

  6. Hector Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    Yes, I already added this change to the plugin. Will be available for everyone in the next release. Thank you for your suggestion!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WordPress Popular Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.