Title: Custom Post Types &amp; Templating
Last modified: August 20, 2016

---

# Custom Post Types & Templating

 *  [AaronHodges](https://wordpress.org/support/users/aaronhodges/)
 * (@aaronhodges)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/custom-post-types-templating/)
 * Hello,
 * I’ve created a custom post type of “blog” using the following:
 *     ```
       add_action( 'init', 'create_post_type' );
       function create_post_type() {
       	register_post_type( 'blog',
       		array(
       		'labels' => array(
       			'name' => __( 'Blogs' ),
       			'singular_name' => __( 'Blog' )
       			),
       		'public' => true,
       		'has_archive' => true,
       		'supports' => array(
       			'title',
       			'editor',
       			'excerpt',
       			'thumbnail',
       			'revisions'
       			),
       		'menu_position' => 20,
       		'taxonomies' => array('category', 'post_tag')
       		)
       	);
       }
       ```
   
 * Now the problem lies with getting this to display in my files.
 * I have single.php and single-blog.php but still when navigating to the page i
   receieve a “Page not found”… So for some reason it’s not using either of my templates.
   The same for the archive.php and archive-blog.php.
 * I can use Query posts to get to the date – but obviously I need to be able to
   navigate to [http://mysite.com/blog/&#8230](http://mysite.com/blog/&#8230);
 * Any help appreciated.
 * Aaron

The topic ‘Custom Post Types & Templating’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [AaronHodges](https://wordpress.org/support/users/aaronhodges/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/custom-post-types-templating/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
