Forums

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

  1. Jinxity
    Member
    Posted 8 months 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. Héctor Cabrera
    Member
    Plugin Author

    Posted 8 months 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 8 months ago #

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

  4. Héctor Cabrera
    Member
    Plugin Author

    Posted 8 months 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 8 months 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. Héctor Cabrera
    Member
    Plugin Author

    Posted 8 months ago #

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

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.