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
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?
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
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);
That worked!! I just had to change ‘term’ to ‘terms’ and it fixed the issue! Thank you so much!
Thread Starter
indym
(@indym)
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.