
-
AuthorPosts
-
February 26, 2015 at 2:58 pm #402684
Hi there,
im trying to display the authors page, but as long as the authors post types are custom post types, nothing is displayed.
Do you have any ideas?
Thank you!
-
This topic was modified 10 years, 4 months ago by
fawnulm.
February 26, 2015 at 10:19 pm #403024Hey fawnulm!
How did you create the post types? Are you sure you have set the correct values for, “has_archive”, “publicly_queryable”, and “exclude_from_search”? http://codex.wordpress.org/Function_Reference/register_post_type
Best regards,
ElliottFebruary 27, 2015 at 11:57 am #403336Hi Elliott,
thanks for your reply. And yes, I did deactivate exlude from search, I activated the archive and also publiclyy queryable as you can see here : http://pl.vc/4z3xy . I created the custom post types with CPT UI. I already uninstalled and reinstalled it, without effort.
Regards,
fawnulm
-
This reply was modified 10 years, 4 months ago by
fawnulm.
March 2, 2015 at 5:18 pm #404584Hi!
Try adding this to the bottom of your functions.php file.
add_action( 'pre_get_posts', 'enfold_customization_author_archives' ); function enfold_customization_author_archives( $query ) { if ( $query -> is_author ) { $query -> set( 'post_type', 'any' ); } remove_action( 'pre_get_posts', 'enfold_customization_author_archives' ); }
Cheers!
ElliottMarch 2, 2015 at 6:39 pm #404685Hi Elliot,
thanks a lot, this did it :-)
In WordPress, I added some Fake Authors, Like “Author a & Author b” to have the possibility to set multiple persons as an author of a post.
So, when calling the author site, of course those posts of multiple authors do not appear. But I want to list those posts also.
Ist there something like
add_action( 'pre_get_posts', 'enfold_customization_author_archives' ); function enfold_customization_author_archives( $query ) { <strong>if ( $query -> is_author && ANOTHER_AUTHOR ) { $query -> set( 'post_type', 'any' ); }</strong> remove_action( 'pre_get_posts', 'enfold_customization_author_archives' ); }
March 3, 2015 at 7:31 pm #405344Hey!
So you created a new author named “Author & Author” to kind of display a post by two authors? If you want to check for a certain author then you could try using this is_author function, http://codex.wordpress.org/Function_Reference/is_author.
Cheers!
ElliottMarch 5, 2015 at 3:31 pm #406440 -
This topic was modified 10 years, 4 months ago by
-
AuthorPosts
- The topic ‘author's page with custom post type’ is closed to new replies.