Title: Adding custom post type to
Last modified: August 30, 2016

---

# Adding custom post type to

 *  [deodev](https://wordpress.org/support/users/deodev/)
 * (@deodev)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/adding-custom-post-type-to/)
 * Hello,
 * I am looking for a way to incorporate custom post types to my autor page?
    Any
   idea how i can so … custom post type of autor include?
 * See here the URL.
    [http://ab-isolutions.nl/dev/pro-ondernemer/author/nico-praat/](http://ab-isolutions.nl/dev/pro-ondernemer/author/nico-praat/)
   Thank you.
 * Kind reagards,
    Amadeo

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * (@jcastaneda)
 * THEME COFFEE MONKEY
 * [10 years, 7 months ago](https://wordpress.org/support/topic/adding-custom-post-type-to/#post-6574779)
 * Hi deodev!
 * One way I can think of would be using the `pre_get_posts` filter.
 * Something like:
 *     ```
       add_filter( 'pre_get_posts', 'add_post_types_to_author' );
       function add_post_types_to_author( $query ){
       	// set the new post type to return, and check if we are in
       	// an author archive page
       	if( $query->is_main_query() && !is_admin() && $query->is_author() ){
       		$query->set( 'post_type', array( 'post', 'page', 'download' ) );
           }
   
       	// Return our new query
       	return $query;
       }
       ```
   
 * Sort of a rough start but you can alter to your choosing. You can use that in
   a child theme’s `funtcions.php` file, or a parent theme’s `functions.php` file,
   or even a functionality plugin. A little more information about the filter:
    
   [https://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts](https://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts)
 * Hope that helps!
 *  [wpfan1000](https://wordpress.org/support/users/wpfan1000/)
 * (@wpfan1000)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/adding-custom-post-type-to/#post-6574803)
 * Hallo,
 * Pretty straightforward:
 * 1) Create the custom post type – I assume you already have done this?
 * 2) Create a template for the author page
 * 3) In the template:
 * a) Get the current author id
 * b) Use a Standard loop wp_query that looks for all posts of the custom post type
   that are authored by the current author.
 * See
 * [https://codex.wordpress.org/Class_Reference/WP_Query](https://codex.wordpress.org/Class_Reference/WP_Query)
 * [https://codex.wordpress.org/Class_Reference/WP_Query#Standard_Loop](https://codex.wordpress.org/Class_Reference/WP_Query#Standard_Loop)
 * [https://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters](https://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters)
 * [https://codex.wordpress.org/Class_Reference/WP_Query#Type_Parameters](https://codex.wordpress.org/Class_Reference/WP_Query#Type_Parameters)
 * Hope this helps 🙂
 * Groetjes

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Adding custom post type to’ is closed to new replies.

## Tags

 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [wpfan1000](https://wordpress.org/support/users/wpfan1000/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/adding-custom-post-type-to/#post-6574803)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
