Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guest Author Page #201

Closed
MikeNGarrett opened this issue May 9, 2014 · 8 comments
Closed

Guest Author Page #201

MikeNGarrett opened this issue May 9, 2014 · 8 comments

Comments

@MikeNGarrett
Copy link

/author/[author_slug] is no longer working for guest authors. The template is returning a 404.

@matthewpizza
Copy link

It looks like the change in 2ce2ce8 is causing the 404.

WordPress/Co-Authors sees the co-author as having 0 posts and is 404ing. The fix we’ve found is to trigger an update for the offending co-author. Either updating in the admin or running update_author_term_post_count() from the WP-CLI update-author-terms.

Also good to take a look at the coauthors_count_published_post_types filter if you are using custom post types.

cc @MikeNGarrett @danielbachhuber

@maxfenton
Copy link

Running into the same problem. Since updating the plugin, /author/[author_slug] does not work for guest authors.

Edit: two links that might save some searching for someone down the road:

  1. https://wordpress.org/support/topic/authors-names-dont-show-up-in-various-places-taxonomy-30
  2. https://wordpress.org/support/topic/here-is-sample-code-to-get-co-author-working-on-author-page
  3. https://gist.github.com/anonymous/4227978

@maxfenton
Copy link

I haven't been able to test @matthewspencer's fix, so I basically reverted 2ce2ce8 by making a custom function in my theme functions.php with a modified version of the older fix_author_page

remove_filter( 'posts_selection', array( $coauthors_plus, 'fix_author_page' ) );
remove_action( 'the_post', array( $coauthors_plus, 'fix_author_page' ) );
add_filter( 'posts_selection', 'mf_fix_author_page' ); 
add_action( 'the_post', 'mf_fix_author_page' );
function mf_fix_author_page() { /* ... */ }

@rebeccahum
Copy link
Contributor

@MikeNGarrett Are you still experiencing this issue? Have you tried @matthewspencer's fix? That wp cli command should update the guest author's posts with the correct amount.

@MikeNGarrett
Copy link
Author

This was so long ago that I'm not sure the context of the original issue. I know we found a way to work around the issue way back then, but I'm not sure if the original issue is fixed.

@jqueryalmeida
Copy link

Solution:
function co_author_archive($query) { if ($query->is_author) $query->set( 'post_type', array('custom_post', 'post') ); remove_action( 'pre_get_posts', 'co_author_archive' ); } add_action('pre_get_posts', 'co_author_archive');

@rebeccahum
Copy link
Contributor

Hi @jqueryalmeida, thanks so much for your contribution. Would you be able to submit a PR for this?

@trepmal
Copy link
Contributor

trepmal commented Jul 7, 2017

I think this is resolved in #440.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants