Title: custom post type loop template override
Last modified: August 22, 2016

---

# custom post type loop template override

 *  [bsapaka](https://wordpress.org/support/users/bsapaka/)
 * (@bsapaka)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/custom-post-type-loop-template-override/)
 * I have a registered post type “portfolio.” The loop/index page for recent portfolio
   posts loaded by default by loading “portfolio” as the page, example: mysite.com/
   portfolio (my permalinks are set to page name).
 * This page loads a default post template with the portfolio posts in place. No
   matter what I do, I can’t make mysite.com/portfolio use a different template.
   I would like to for it to use portfolio.php in my child theme, but it does not
   load that code, but instead uses the blog template no matter what
 * My registering the CPT in functions.php of child theme:
 * add_action( ‘init’, ‘portfolio_init’ );
    /** * Register a portfolio post type.**
   [@link](https://wordpress.org/support/users/link/) [http://codex.wordpress.org/Function_Reference/register_post_type](http://codex.wordpress.org/Function_Reference/register_post_type)*/
   function portfolio_init() { $labels = array( ‘name’ => _x( ‘Portfolio’, ‘post
   type general name’, ‘your-plugin-textdomain’ ), ‘singular_name’ => _x( ‘Portfolio
   Item’, ‘post type singular name’, ‘your-plugin-textdomain’ ), ‘menu_name’ => 
   _x( ‘Portfolio’, ‘admin menu’, ‘your-plugin-textdomain’ ), ‘name_admin_bar’ =
   > _x( ‘Portfolio Item’, ‘add new on admin bar’, ‘your-plugin-textdomain’ ), ‘
   add_new’ => _x( ‘Add New’, ‘portfolio’, ‘your-plugin-textdomain’ ), ‘add_new_item’
   => __( ‘Add New Portfolio Item’, ‘your-plugin-textdomain’ ), ‘new_item’ => __(‘
   New Portfolio Item’, ‘your-plugin-textdomain’ ), ‘edit_item’ => __( ‘Edit Portfolio
   Item’, ‘your-plugin-textdomain’ ), ‘view_item’ => __( ‘View Portfolio Item’, ‘
   your-plugin-textdomain’ ), ‘all_items’ => __( ‘All Portfolio Items’, ‘your-plugin-
   textdomain’ ), ‘search_items’ => __( ‘Search Portfolio Items’, ‘your-plugin-textdomain’),‘
   parent_item_colon’ => __( ‘Parent Portfolio Items:’, ‘your-plugin-textdomain’),‘
   not_found’ => __( ‘No portfolio items found.’, ‘your-plugin-textdomain’ ), ‘not_found_in_trash’
   => __( ‘No portfolio items found in Trash.’, ‘your-plugin-textdomain’ ) );
 *  $args = array(
    ‘labels’ => $labels, ‘public’ => true, ‘publicly_queryable’ 
   => true, ‘show_ui’ => true, ‘show_in_menu’ => true, ‘query_var’ => true, ‘rewrite’
   => array( ‘slug’ => ‘portfolio’ ), ‘capability_type’ => ‘post’, ‘has_archive’
   => true, ‘hierarchical’ => false, ‘menu_position’ => null, ‘supports’ => array(‘
   title’, ‘editor’, ‘author’, ‘thumbnail’, ‘excerpt’, ‘comments’ ) );
 *  register_post_type( ‘portfolio’, $args );
    }

The topic ‘custom post type loop template override’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [bsapaka](https://wordpress.org/support/users/bsapaka/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/custom-post-type-loop-template-override/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
