[Resolved] Author page shows repeating posts
I just installed 3.0.4 and am having a problem with the author archive page. When the plugin is activated, I see the first post repeated multiple times:
When I deactivate the plugin, I see each of the authors posts:
I applied the code fix reference at http://pastebin.com/Lb89JP17 on the above mentioned link. This was a replacement of posts_join_filter function. I saw no difference in the way the author archive page was displayed. It still is repeating the author’s same post multiple times. When I deactive the plugin, I see each of the author’s individual posts.
Any other suggestions?
@rzeisler did you edit the user’s user_nicename value by chance? Is this problem happening with different users?
Is the user_nicename the field that is displayed as Nickname under Edit User?
If the answer is yes, then yes, most user’s Nicknames are changed to be their name followed by a title (like ‘John Smith, Chief Executive Officer, XYZ Company’). and then this is used as the ‘Display name publicly as’ setting.
Are you using this field as a ‘key’ instead of the user_id?
Are you assuming that the Username and Nickname are always equal?
You also asked if this problem was happening with different users. The answer is yes, it is happening to different users, but I only included the one example above.
Can you see if the discussion in this thread is relevant to your issue?
Read a little bit of the discussion thread. I used mysql to dump the wp_user table, displaying user_login and user_nicename fields. Rarely do they ever match. Many of the user_login values are for example ‘John.Smith’ and the user_nicename becomes ‘john-smith’.
I don’t know if case matters in your comparison, but anytime a user’s user_login has uppercase characters, the user_nicename replaces it with lowercase characters.
Any blank character (space) is allowed in user_login but is replaced with a dash in the user_nicename.
Any period is allowed in the user_login but is replaced with a dash in the user_nicename.
I did not use a plugin that allowed me to modify the user_nicename. They are what the system created.
Odd. It doesn’t sound like this is that same issue. Can you provide the code you’re using to output the author profile page?
This is the _post.php file from my theme:
Is this what you are looking for?
Do you have an author.php file?
Very interesting. On my website, I’ve noticed that only the authors who don’t share an article with someone else have repeating posts on their author page. I tested my hypothesis by adding a second author to one of the single-author posts and that fixed my problem.
I’m still very confused and have no idea why this worked. Hopefully, this provides you guys with some sort of clue.
@daniel Bachhuber – my theme does not have an author.php file.
Based on @wp Yoda’s comment, I added another author to a post and now the author page for both authors displays properly. The author with multiple posts now shows all the different posts. The author that I added only shows the one post (that author previously had zero posts).
Then I went to another post for a different author. I verified that on the author page it showed the first article repeating. I then edited the post and clicked the Update button (changed nothing in the post). Then I viewed the post and click on the author (coauthor_post_links) link and I see all the posts for that author.
I am not sure what is changing when I click the Update button, but something is “fixing” the problem that is causing the repeating posts on the author page.
I backed out the code fix referenced at http://pastebin.com/Lb89JP17 that I had previously installed. I then updated (no changes) a post for an author that was showing repeating posts for the same article. When I went to the author page (by clicking on the coauthor_post_links) all was good, no repeating/duplicate posts.
Each time I update a post (making no changes), the author page for that author will now show their posts correctly.
It appears that something is going on when you update a post that fixes the problem. Is there any way to do this in mass?
Co-Authors Plus uses a custom taxonomy behind the scenes to associate bylines with posts. I suspect what’s happening is that you don’t have terms for each author and this is causing some bugginess. I’ll see if I can track it down.
In the interim, hitting Update on one post per author should do the trick. There’s a wp-cli command you can use instead if you’re familiar.
- The topic ‘[Resolved] Author page shows repeating posts’ is closed to new replies.