WordPress.org

Ready to get started?Download WordPress

Forums

Co-Authors Plus
[resolved] Issue with multiple author templates (7 posts)

  1. indym
    Member
    Posted 1 year ago #

    So I managed to get co-authors working on the front/back end.

    The issue I am having is on my site we have different profile templates for certain users. The original profile template works fine and one post will show up on both of the authors profile page. However this second version which is basically the same template is not showing the post on the co-authors page.

    Is this something to do with the plugin not being able to work with different templates? Or is this theme related?

    Thanks for reading.

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

  2. mgunnin
    Member
    Posted 1 year ago #

    We could really use some help on this issue.

    Co-Authors works on this page http://vods.leaguepedia.com/profile/leaguepedia/

    but for a different profile that is assigned to "Gamers", it doesn't work.. For instance, this page -- http://vods.leaguepedia.com/profile/link/

    Thank you

  3. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    To confirm — both of you are using the template tags in your theme?

    However this second version which is basically the same template is not showing the post on the co-authors page.

    This sounds like your theme uses an alternate query to generate the list of co-author posts. Can you share what's inside of your author.php template using pastebin?

  4. mgunnin
    Member
    Posted 1 year ago #

    Thank you for your reply!

    Yes, I have been adding the templates tags to any file that includes the_author_post_links but not to the template pages below as I was unsure about "the_author_meta" and other variances. We have two author templates, "author.php" and "author-template-gamer.php". The code for each is pasted below.

    Thank you so much for your assistance!
    -Matt

    author.php
    http://pastebin.com/sbspd4Dg

    author-template-gamer.php
    http://pastebin.com/HZmrwuKb

  5. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    It looks like you have something like the following in both templates:

    $args = array(
              'view' => 'grid-small',
              'cat' => $cat,
              'link' => $link,
              'author' => $user_id,
              'post_type' => 'post',
              'ignore_sticky_posts' => true,
              'posts_per_page' => 3
    );
    dp_section_box($args);

    This means the posts in those sections are limited to posts where post_author == $user_id. Because Co-Authors Plus stores byline information as taxonomy terms, I suspect that any post where the user is the second author is missing from your list.

    I'm not sure how dp_section_box() works, but you might be able to pass a tax query to it. If that's the case, it would look something like this:

    $args = array(
              'view' => 'grid-small',
              'cat' => $cat,
              'link' => $link,
              'tax_query' => array(
                        array(
                                  'taxonomy' => 'author',
                                  'term' => get_queried_object()->user_login,
                                  'field' => 'name',
                        )
              ),
              'post_type' => 'post',
              'ignore_sticky_posts' => true,
              'posts_per_page' => 3
    );
    dp_section_box($args);
  6. mgunnin
    Member
    Posted 1 year ago #

    That worked!! I just had to change 'term' to 'terms' and it fixed the issue! Thank you so much!

  7. indym
    Member
    Posted 1 year ago #

    Hey Daniel,

    First thanks so much for the assistance you've been a great help.

    However we're noticing a weird issue with the new code in place. Some thumbnails are not showing for the 4 categories we have on the gamer templates. The category thumbnails missing are not specific but random.

    Using the older version of author-template-gamer fixes everything but then we're back to where we were.

    Is there anything you can see in the code you provided that is causing this issue?

    Example:

    http://vods.leaguepedia.com/profile/chaox/
    http://vods.leaguepedia.com/profile/scarra/

    As you can see each one has different thumbnails showing even though each category has content.

    Thanks again for helping us with this issue.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags