Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Change the author link on posts to buddypress profile


  • hornets2002
    Participant

    @hornets2002

    I currently run a multi-author blog and I was wondering if it was possible to replace the author link after a post to one that takes you to that author’s buddypress profile instead.

    Thanks in advance! :)

Viewing 6 replies - 1 through 6 (of 6 total)

  • Roger Coathup
    Participant

    @rogercoathup

    The following can be used on a single post page to give you a link to the author’s buddy press profile:

    `$author_id = get_the_author_meta( ‘ID’ );

    <a href="” rel=”bookmark” class=”fn url”>…`


    hornets2002
    Participant

    @hornets2002

    Thanks for the quick response. I tried playing around with code you gave me in Single.php, but I failed to successfully implement it on my site.

    Here is the actual code that I am trying to change. It is the authorbox that displays under each article. As of now, the code fetches the link to the respective author archive pages when you either click on the author avatar or their displayed username. I would like these links to be altered so they, instead, take you to that individual’s buddypress profile. Perhaps showing the actual code will make more sense when it comes to my request. It would be great if you could just re-post the code below after it has been modified. Thanks so much!

    `

    <a href="”>

    `

    Rogers code works perfectly well, I have just modified a 2011 author block to display author link as bp profile if bp active or fallback to the 2011 author block, the code Roger showed you gives you the new code to insert into the href=””


    @mercime
    Keymaster

    @mercime

    What Roger and Hugo said. To see the code in context, see how it’s done in bp-default theme’s single.php file –> https://buddypress.trac.wordpress.org/browser/tags/1.5.6/bp-themes/bp-default/single.php#L14


    hornets2002
    Participant

    @hornets2002

    Thanks for the help everyone, works perfectly now! @mercime, I’m not really experienced with code, so your example helped me understand how to correctly use Roger’s solution, I appreciate it :)

    @hornets2002 hey i have the same problem here
    but i cant figure it out like you
    can you plz tell me the full code to get the author profile
    thx in advance

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] Change the author link on posts to buddypress profile’ is closed to new replies.
Skip to toolbar