Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #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.
    #403024

    Hey 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,
    Elliott

    #403336

    Hi 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.
    #404584

    Hi!

    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!
    Elliott

    #404685

    Hi 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' ); 
    }
    #405344

    Hey!

    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!
    Elliott

    #406440

    thx

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘author's page with custom post type’ is closed to new replies.