Support » Fixing WordPress » Pages in Authors page

  • 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.

    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)
  • You must be logged in to reply to this topic.