WordPress.org

Ready to get started?Download WordPress

Forums

Co-Authors Plus
[resolved] Multiple Author Bio in Archive page (15 posts)

  1. andyildefonso
    Member
    Posted 2 years ago #

    I used the co-author plug-in for this article and manage to setup the authors info below the article. Here's the link:
    http://www.asiapathways-adbi.org/2012/03/reforming-asias-trade-in-services-will-help-human-development/

    But, when you click the archive link of the author, it display also the co-author bio instead of only one bio.

    See below the code. Any help is deeply appreciated.

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    http://wordpress.org/extend/plugins/co-authors-plus/

  2. andyildefonso
    Member
    Posted 2 years ago #

    Anyone? Thanks.

  3. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 2 years ago #

    Posting twice won't get you a quicker response ;)

    It looks like you're modifying a function that's used in multiple places. You might use a conditional like is_singular() to do some part of the function on the single post page, and then default to the original code for the archive pages.

  4. andyildefonso
    Member
    Posted 2 years ago #

    Hi Daniel.

    Sorry for the duplicate post.

    I hope you can give me more idea on how to use this is_singular() function because I'm not PHP savvy.

    I know little debugging in PHP but not as deep as your knowledge.

    Hope you can give me more option to use this co-author plug-in for my archive page.

    To give more information, here are the links I want of the post I want to resolve.

    This article has two authors: http://www.asiapathways-adbi.org/2012/03/reforming-asias-trade-in-services-will-help-human-development/

    Below the article, you will notice that the authors bio is displayed. Once you click the archive link of the author, is display the archive articles but also the two bio's. Would it be possible to display only one bio instead of two like the link below:
    http://www.asiapathways-adbi.org/author/stephen-groff/

    Any help is deeply appreciated.

    Thank you very much.

  5. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 2 years ago #

    The singular condition should go into the woo_author_box() function somewhat like this:

    function woo_author_box() {
    
    if ( is_singular() ) {
    
    // Do the co-authors plus code in here
    
    } else {
    
    // Do whatever you had before
    
    }
    
    }

    Based on the example you submitted, there's already some use of is_singular() to conditionally display the profile link. It might be worth playing around with that.

  6. andyildefonso
    Member
    Posted 2 years ago #

    Hi Daniel,

    Thank you for your help.

    Now, I able to display only one author for the archive page.

    See the link below:
    http://www.asiapathways-adbi.org/author/ben-shepherd/

    Unfortunately, for the co-author archive page, it displays the first co-author bio instead of the second one:
    http://www.asiapathways-adbi.org/author/gp-gloria-pasadilla/

    Thank you very for your help in advance.

    Here's my code based on the previous post:

    [78 lines of code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

  7. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 2 years ago #

    On the author.php template, you should use get_queried_object_id() to get the user ID for the author.

    Post your code in pastebin and I'll show you what you need to modify

  8. andyildefonso
    Member
    Posted 2 years ago #

    Hi Daniel,

    Thank you again for your help.

    Here's the code:

    http://pastebin.com/embed_iframe.php?i=uZ92Tn6H

  9. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 2 years ago #

    Sorry, can you pastebin the woo_author_box() function again?

  10. andyildefonso
    Member
    Posted 2 years ago #

  11. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    Still needing help with this?

  12. andyildefonso
    Member
    Posted 1 year ago #

    Hi Daniel,

    Yes. I would really appreciate your help on this one.

    Thanks.
    Andy

  13. andyildefonso
    Member
    Posted 1 year ago #

    Hi Daniel,

    Any feedback?

    Thanks for your help in advance.

    Regards,
    Andy

  14. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    Sorry about the delay. Here's what your new woo_author_box() should be:

    https://gist.github.com/21788891d530b71ffbc3

    Here's the extent of the changes I made:

    https://img.skitch.com/20120426-t57rmsnd5nshj3q5sx5s7tdeid.jpg

    Basically, what I did was to add a check in the code that pulls the queried object ID instead of the post_author for the first post if you're pulling the author box on an author archive. The original approach is problematic because it uses the post_author value which, when you're using Co-Authors Plus, is the first author on the post.

  15. andyildefonso
    Member
    Posted 1 year ago #

    Hi Daniel,

    It works fine now.

    I really appreciate your help on this one.

    Regards,
    Andy

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic