• On the Authors page one sees excerpts of all the Posts this author wrote. We would like to show the Pages too. Is there a way to do this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • 1. Hook into pre_get_posts action
    2. Check if the current query is ‘author’ archive query
    3. Add ‘page’ to the array of post types being fetched.

    Thread Starter tastymouse

    (@tastymouse)

    Where can I find this? Can you pleas explain a little further?
    Thanks, Tom

    The following piece of code taken from this answer should serve the purpose:

    if ($query->is_author)
            $query->set( 'post_type', array('page', 'post') );
        remove_action( 'pre_get_posts', 'custom_post_author_archive' );
    }
    add_action('pre_get_posts', 'custom_post_author_archive'); 
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Pages in Authors page’ is closed to new replies.