You have to use the Slug of your Custom Post Type “portfolio” for the filename, as you pointed out, single-portfolio.php
is correct if your slug is “portfolio”.
You just have to take one more step, create the file in the Theme directory (the same folder where your single.php
is located).
WordPress automatically selects the single-portfolio.php
for the Portfolio CPT if the file is there, and if it is not there, it takes the single.php
.
Related Posts:
- Custom CSS is overwritten by WordPress?
- How can I get the title attribute from get_the_post_thumbnail()?
- Retaining old HTML archives and displaying themes conditionally
- Change Default Image HTML
- Edit raw HTML of the landing page
- In which directory do I find a specific HTML code of my wordpress page? Some of it seems to be missing after checking all pages [closed]
- Can I apply a WP theme to a specific custom page template?
- Can I create multiple instances of the BuddyPress Activity Stream with separate themes? [closed]
- How do I apply my CSS to a theme page?
- How to use get_page_by_title() with qTranslate?
- Display a specific dynamic sidebar widgets on a specific page
- Multi-level page hierarchy
- Understanding Theme specific Code
- Own Theme Customizer displays error message when saving, saving still works
- Theme option not saved if in wp_editor() and html decoded
- Customizing page content layout
- Putting two themes together to create a complete site
- How does WP generate html?
- Finding and disabling ‘rogue’ stylesheet from header: Source Sans Pro
- Make multiple pages and set template/content on theme activation?
- How to restore file or theme?
- How to transform a custom made static HTML website to a WordPress website [closed]
- Need to edit themes HTML code
- Modifying the markup in the Tag Cloud widget?
- WP HTML Templates – Any way to get bloginfo() or the path to the theme folder?
- How to trace and resolve a theme problem such as flickering links in WordPress? [closed]
- How to edit the font color of the H1 on a single page?
- How to use custom page templates in a theme that hides page template option?
- Setting a new default template for the creation of a page
- Index page is not working
- Insert the current theme header into an external HTML/XHTML file
- Custom theme – pages in menu
- remove preloader in WordPress theme [closed]
- removing side space between para and container on generatepress?
- share wrordpress data between two shared hosts using REST API
- TwentyFourteen Theme : Changing grid layout
- Meta title W3C Validation Error with
- adding a unique page to an existing site
- Standard Way To Do Custom Work Within A Page?
- separate home page into separate pages
- wordpress template page Usage [duplicate]
- Help with responsive theme styling issue
- Remove ALL HTML from single page
- How to set thumbnail image for a (child) theme
- Is it possible to stop a theme activation when a certain plugin is not activated
- add image size still doesn’t work even after regenerating thumbnails
- Best location for theme translation files
- WordPress themes under GPL license
- How can I customize the search results in Bones theme?
- How to develop a theme while having another show up
- What is the most idiomatic way to let clients edit phrases in HTML?
- Switch to other theme at URL
- How to load a different theme for categories?
- Can I update themes without enabling maintenance mode?
- How to change sidebar per page?
- Add a series of checkboxes to theme options
- WordPress Theme Development Seemingly Awful Partitioning of Includes?
- Hide default “Recent Comments” Widget if there are no comments yet
- Showing post thumbnail (attachment) on the archive.php category listing
- editing fonts of category links from the_category() funtion
- Theme Check warning wrong direcory for theme
- Posts and Pages not showing on admin, but showing in theme
- How can I add class to every quote element?
- Looking for a fully customisable WP responsive theme to develop a small scale fiverr type site for voice artists [closed]
- Page dissapears when i click save
- How to use command lines an activate theme in wp – cli also setup Vagrant/Sage Theme?
- Is wordpress big enough for my project [closed]
- What hook is the currently active theme’s functions.php file loaded on? [duplicate]
- How to get theme screenshot
- i would like to have 3 default columns editable in guttenberg
- Define theme information other than through style.css
- Change avatar on themed profile page
- Is it possible to open a page with a different theme?
- Create page options for theme?
- Where is the best place to catch useragent?
- Knowing blog name using blog id
- Alternative to Back End Dashboard?
- How can I change the prev / next buttons text to Dutch?
- Woocommerce single product image blurred and small. Actual image is big
- Adding a template in WPTouch
- Make the “Add New Post” one column for all users
- What happened to my Inactive Widgets?
- WP Nanoplex 1.0.3 malfunction
- Cannot change WordPress site title on a staged site
- How to add image from theme files to media library after theme activation?
- How to download my custom theme?
- Understanding the child / parent theme relationship
- Ensure Quality Transition to New WordPress Theme [closed]
- WordPress theme works on linux servers but white screen after move to Xampp
- Own WordPress theme with custom AFCs > Export all to theme format?
- WordPress theme is not displayed properly on other computers
- Customized wordpress theme locally put on someones WordPress account
- Mobile theme switching problems
- How to add different link on each Post [closed]
- EM in CSS different size on wordpress then elsewhere [closed]
- Lost in creating multiple meta boxes
- Can I modify woocommerce themes that are under the GNU General Public License, version 2
- How to remove header “ish” label [closed]
- Fatal error Class-wp-hook, again, but not sure what’s triggering it
- How to remove pop up on website (css changes not visible)?