Make Author.php Include Custom Post Types

I was going through a strange issue where Author page was not showing the posts which belongs to Custom Post Types. After Googling, I found this article which shows how to include Custom Post Types for archives.php

I got inspiration from above mentioned article snippet and wrote the following snippet to modify Author.php page to include Custom Post Types

 

Related posts:

One thought on “Make Author.php Include Custom Post Types”

  1. You should include the author check with category and tag:
    if( is_author() || is_category() || is_tag() && empty( $query->query_vars[‘suppress_filters’] ) )

Leave a Reply

Your email address will not be published. Required fields are marked *