{"id":199,"date":"2014-11-29T07:11:09","date_gmt":"2014-11-29T07:11:09","guid":{"rendered":"http:\/\/128.199.176.160\/?p=199"},"modified":"2026-01-28T16:53:20","modified_gmt":"2026-01-28T11:53:20","slug":"make-author-php-include-custom-post-types","status":"publish","type":"post","link":"https:\/\/wpbrigade.com\/make-author-php-include-custom-post-types\/","title":{"rendered":"Make Author.php Include Custom Post Types"},"content":{"rendered":"\n<p>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 <a title=\"http:\/\/css-tricks.com\/snippets\/wordpress\/make-archives-php-include-custom-post-types\/\" href=\"http:\/\/css-tricks.com\/snippets\/wordpress\/make-archives-php-include-custom-post-types\/\" target=\"_blank\" rel=\"noopener\">article<\/a> which shows how to include Custom Post Types for archives.php<\/p>\n\n\n\n<p>I got inspiration from above mentioned article snippet and wrote the following snippet to modify Author.php page to include Custom Post Types<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">function wpbrigade_author_custom_post_types( $query ) {\n  if( is_author() &amp;&amp; empty( $query-&gt;query_vars['suppress_filters'] ) ) {\n    $query-&gt;set( 'post_type', array(\n     'post', 'my-custom-post-type-here'\n\t\t));\n\t  return $query;\n\t}\n}\nadd_filter( 'pre_get_posts', 'wpbrigade_author_custom_post_types' );<\/pre>\n\n\n\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":286,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_analytify_skip_tracking":false,"footnotes":""},"categories":[571],"tags":[],"class_list":["post-199","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Make Author.php Include Custom Post Types - WPBrigade<\/title>\n<meta name=\"description\" content=\"How to Make Author.Php Include Custom Post Types of your blog, you need to write the following snippet to modify Author.php page.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wpbrigade.com\/make-author-php-include-custom-post-types\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Make Author.php Include Custom Post Types\" \/>\n<meta property=\"og:description\" content=\"How to Make Author.Php Include Custom Post Types of your blog, you need to write the following snippet to modify Author.php page.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wpbrigade.com\/make-author-php-include-custom-post-types\/\" \/>\n<meta property=\"og:site_name\" content=\"WPBrigade\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/WPBrigade\" \/>\n<meta property=\"article:published_time\" content=\"2014-11-29T07:11:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-28T11:53:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wpbrigade.com\/wp-content\/uploads\/2014\/11\/wordpress-brown-logo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Adnan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@wpbrigade\" \/>\n<meta name=\"twitter:site\" content=\"@wpbrigade\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Adnan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/wpbrigade.com\\\/make-author-php-include-custom-post-types\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wpbrigade.com\\\/make-author-php-include-custom-post-types\\\/\"},\"author\":{\"name\":\"Adnan\",\"@id\":\"https:\\\/\\\/wpbrigade.com\\\/#\\\/schema\\\/person\\\/60305aa637f786ceebbf9949f1a24634\"},\"headline\":\"Make Author.php Include Custom Post Types\",\"datePublished\":\"2014-11-29T07:11:09+00:00\",\"dateModified\":\"2026-01-28T11:53:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/wpbrigade.com\\\/make-author-php-include-custom-post-types\\\/\"},\"wordCount\":69,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/wpbrigade.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/wpbrigade.com\\\/make-author-php-include-custom-post-types\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wpbrigade.com\\\/wp-content\\\/uploads\\\/2014\\\/11\\\/wordpress-brown-logo.png\",\"articleSection\":[\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/wpbrigade.com\\\/make-author-php-include-custom-post-types\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/wpbrigade.com\\\/make-author-php-include-custom-post-types\\\/\",\"url\":\"https:\\\/\\\/wpbrigade.com\\\/make-author-php-include-custom-post-types\\\/\",\"name\":\"Make Author.php Include Custom Post Types - WPBrigade\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wpbrigade.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/wpbrigade.com\\\/make-author-php-include-custom-post-types\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/wpbrigade.com\\\/make-author-php-include-custom-post-types\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wpbrigade.com\\\/wp-content\\\/uploads\\\/2014\\\/11\\\/wordpress-brown-logo.png\",\"datePublished\":\"2014-11-29T07:11:09+00:00\",\"dateModified\":\"2026-01-28T11:53:20+00:00\",\"description\":\"How to Make Author.Php Include Custom Post Types of your blog, you need to write the following snippet to modify Author.php page.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/wpbrigade.com\\\/make-author-php-include-custom-post-types\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/wpbrigade.com\\\/make-author-php-include-custom-post-types\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wpbrigade.com\\\/make-author-php-include-custom-post-types\\\/#primaryimage\",\"url\":\"https:\\\/\\\/wpbrigade.com\\\/wp-content\\\/uploads\\\/2014\\\/11\\\/wordpress-brown-logo.png\",\"contentUrl\":\"https:\\\/\\\/wpbrigade.com\\\/wp-content\\\/uploads\\\/2014\\\/11\\\/wordpress-brown-logo.png\",\"width\":350,\"height\":350,\"caption\":\"WordPress, WordPress development\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/wpbrigade.com\\\/make-author-php-include-custom-post-types\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/wpbrigade.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Make Author.php Include Custom Post Types\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/wpbrigade.com\\\/#website\",\"url\":\"https:\\\/\\\/wpbrigade.com\\\/\",\"name\":\"WPBrigade\",\"description\":\"WordPress Development Agency\",\"publisher\":{\"@id\":\"https:\\\/\\\/wpbrigade.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/wpbrigade.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/wpbrigade.com\\\/#organization\",\"name\":\"WPBrigade\",\"url\":\"https:\\\/\\\/wpbrigade.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wpbrigade.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/wpbrigade.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/Screen-Shot-2021-07-02-at-12.42.14-AM.png\",\"contentUrl\":\"https:\\\/\\\/wpbrigade.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/Screen-Shot-2021-07-02-at-12.42.14-AM.png\",\"width\":271,\"height\":63,\"caption\":\"WPBrigade\"},\"image\":{\"@id\":\"https:\\\/\\\/wpbrigade.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/facebook.com\\\/WPBrigade\",\"https:\\\/\\\/x.com\\\/wpbrigade\",\"https:\\\/\\\/www.instagram.com\\\/wpbrigade.agency\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/wpbrigade\",\"https:\\\/\\\/www.youtube.com\\\/c\\\/Wpbrigade\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/wpbrigade.com\\\/#\\\/schema\\\/person\\\/60305aa637f786ceebbf9949f1a24634\",\"name\":\"Adnan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/db5b529a3f883d64715e1ccef9fbb1b5d602be4f9430721c997513571f1ce99f?s=96&d=retro&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/db5b529a3f883d64715e1ccef9fbb1b5d602be4f9430721c997513571f1ce99f?s=96&d=retro&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/db5b529a3f883d64715e1ccef9fbb1b5d602be4f9430721c997513571f1ce99f?s=96&d=retro&r=g\",\"caption\":\"Adnan\"},\"sameAs\":[\"http:\\\/\\\/adnan.pk\\\/\",\"https:\\\/\\\/x.com\\\/wpbrigade\"]}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Make Author.php Include Custom Post Types - WPBrigade","description":"How to Make Author.Php Include Custom Post Types of your blog, you need to write the following snippet to modify Author.php page.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wpbrigade.com\/make-author-php-include-custom-post-types\/","og_locale":"en_US","og_type":"article","og_title":"Make Author.php Include Custom Post Types","og_description":"How to Make Author.Php Include Custom Post Types of your blog, you need to write the following snippet to modify Author.php page.","og_url":"https:\/\/wpbrigade.com\/make-author-php-include-custom-post-types\/","og_site_name":"WPBrigade","article_publisher":"https:\/\/facebook.com\/WPBrigade","article_published_time":"2014-11-29T07:11:09+00:00","article_modified_time":"2026-01-28T11:53:20+00:00","og_image":[{"width":350,"height":350,"url":"https:\/\/wpbrigade.com\/wp-content\/uploads\/2014\/11\/wordpress-brown-logo.png","type":"image\/png"}],"author":"Adnan","twitter_card":"summary_large_image","twitter_creator":"@wpbrigade","twitter_site":"@wpbrigade","twitter_misc":{"Written by":"Adnan","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wpbrigade.com\/make-author-php-include-custom-post-types\/#article","isPartOf":{"@id":"https:\/\/wpbrigade.com\/make-author-php-include-custom-post-types\/"},"author":{"name":"Adnan","@id":"https:\/\/wpbrigade.com\/#\/schema\/person\/60305aa637f786ceebbf9949f1a24634"},"headline":"Make Author.php Include Custom Post Types","datePublished":"2014-11-29T07:11:09+00:00","dateModified":"2026-01-28T11:53:20+00:00","mainEntityOfPage":{"@id":"https:\/\/wpbrigade.com\/make-author-php-include-custom-post-types\/"},"wordCount":69,"commentCount":3,"publisher":{"@id":"https:\/\/wpbrigade.com\/#organization"},"image":{"@id":"https:\/\/wpbrigade.com\/make-author-php-include-custom-post-types\/#primaryimage"},"thumbnailUrl":"https:\/\/wpbrigade.com\/wp-content\/uploads\/2014\/11\/wordpress-brown-logo.png","articleSection":["WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wpbrigade.com\/make-author-php-include-custom-post-types\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/wpbrigade.com\/make-author-php-include-custom-post-types\/","url":"https:\/\/wpbrigade.com\/make-author-php-include-custom-post-types\/","name":"Make Author.php Include Custom Post Types - WPBrigade","isPartOf":{"@id":"https:\/\/wpbrigade.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wpbrigade.com\/make-author-php-include-custom-post-types\/#primaryimage"},"image":{"@id":"https:\/\/wpbrigade.com\/make-author-php-include-custom-post-types\/#primaryimage"},"thumbnailUrl":"https:\/\/wpbrigade.com\/wp-content\/uploads\/2014\/11\/wordpress-brown-logo.png","datePublished":"2014-11-29T07:11:09+00:00","dateModified":"2026-01-28T11:53:20+00:00","description":"How to Make Author.Php Include Custom Post Types of your blog, you need to write the following snippet to modify Author.php page.","breadcrumb":{"@id":"https:\/\/wpbrigade.com\/make-author-php-include-custom-post-types\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wpbrigade.com\/make-author-php-include-custom-post-types\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpbrigade.com\/make-author-php-include-custom-post-types\/#primaryimage","url":"https:\/\/wpbrigade.com\/wp-content\/uploads\/2014\/11\/wordpress-brown-logo.png","contentUrl":"https:\/\/wpbrigade.com\/wp-content\/uploads\/2014\/11\/wordpress-brown-logo.png","width":350,"height":350,"caption":"WordPress, WordPress development"},{"@type":"BreadcrumbList","@id":"https:\/\/wpbrigade.com\/make-author-php-include-custom-post-types\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wpbrigade.com\/"},{"@type":"ListItem","position":2,"name":"Make Author.php Include Custom Post Types"}]},{"@type":"WebSite","@id":"https:\/\/wpbrigade.com\/#website","url":"https:\/\/wpbrigade.com\/","name":"WPBrigade","description":"WordPress Development Agency","publisher":{"@id":"https:\/\/wpbrigade.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wpbrigade.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/wpbrigade.com\/#organization","name":"WPBrigade","url":"https:\/\/wpbrigade.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpbrigade.com\/#\/schema\/logo\/image\/","url":"https:\/\/wpbrigade.com\/wp-content\/uploads\/2021\/07\/Screen-Shot-2021-07-02-at-12.42.14-AM.png","contentUrl":"https:\/\/wpbrigade.com\/wp-content\/uploads\/2021\/07\/Screen-Shot-2021-07-02-at-12.42.14-AM.png","width":271,"height":63,"caption":"WPBrigade"},"image":{"@id":"https:\/\/wpbrigade.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/WPBrigade","https:\/\/x.com\/wpbrigade","https:\/\/www.instagram.com\/wpbrigade.agency\/","https:\/\/www.linkedin.com\/company\/wpbrigade","https:\/\/www.youtube.com\/c\/Wpbrigade"]},{"@type":"Person","@id":"https:\/\/wpbrigade.com\/#\/schema\/person\/60305aa637f786ceebbf9949f1a24634","name":"Adnan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/db5b529a3f883d64715e1ccef9fbb1b5d602be4f9430721c997513571f1ce99f?s=96&d=retro&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/db5b529a3f883d64715e1ccef9fbb1b5d602be4f9430721c997513571f1ce99f?s=96&d=retro&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/db5b529a3f883d64715e1ccef9fbb1b5d602be4f9430721c997513571f1ce99f?s=96&d=retro&r=g","caption":"Adnan"},"sameAs":["http:\/\/adnan.pk\/","https:\/\/x.com\/wpbrigade"]}]}},"_links":{"self":[{"href":"https:\/\/wpbrigade.com\/wpb-api\/wp\/v2\/posts\/199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpbrigade.com\/wpb-api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpbrigade.com\/wpb-api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpbrigade.com\/wpb-api\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpbrigade.com\/wpb-api\/wp\/v2\/comments?post=199"}],"version-history":[{"count":1,"href":"https:\/\/wpbrigade.com\/wpb-api\/wp\/v2\/posts\/199\/revisions"}],"predecessor-version":[{"id":318925,"href":"https:\/\/wpbrigade.com\/wpb-api\/wp\/v2\/posts\/199\/revisions\/318925"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpbrigade.com\/wpb-api\/wp\/v2\/media\/286"}],"wp:attachment":[{"href":"https:\/\/wpbrigade.com\/wpb-api\/wp\/v2\/media?parent=199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpbrigade.com\/wpb-api\/wp\/v2\/categories?post=199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpbrigade.com\/wpb-api\/wp\/v2\/tags?post=199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}