I think you are a bit confused as to what Page Attributes will give you access to. To the best of my knowledge you do not get a drop down to choose a template (as you do on Pages) as an automatic function on custom post types.
That being said, you are on the right track. You need to make an archive-portfolio.php file as well to display all of the portfolio posts as well.
You do not need an additional WP_Query to pull in your correct post type – WordPress will do that correctly based on single-POSTTYPE.php.
Ditch that line and revert to the standard loop – and ditch the template name as well. It does not do anything. If you really, really, really want to use this as a Page, rename the template page-portfolio.php and create a page, select this template and you’ll be off like a shot.
Related Posts:
- What are the differences between custom post type and custom page templates?
- Setting a custom sub-path for blog without using pages?
- Loading custom page template via plugin
- Post formats “audio” and “video” only showing in index.php
- Ordering Posts List By Taxonomy Terms?
- Creating a Custom Post Type for Inserting Preset Content into Post & Pages?
- WordPress keeps fetching the archive page instead of the template page
- How to add custom template in plugin?
- How to quickly switch custom post type singular template?
- Add a Template to a custom post type
- How to use a dedicated template for the Custom Post Type from a plugin?
- WordPress calls archive page instead of Custom Page Template
- How do I Make a custom post type get a custom post template in a plugin
- How to sort list of custom posts to get view like a tree of posts under categories and their children’s categories?
- Dynamic page.php template for custom post types
- Pagination on a custom page template
- Multiple templates for custom post type
- Custom Post Types, Page Templates and Pagination. Why do I get a 404 Error?
- How to make an archive page displaying posts in a date range
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- is_page_template not working as expected
- Child page in custom post throws 404 page not found
- CPT: archive-cpt.php VS custom page template
- Multiple portfolios with one custom post type?
- Take Variables Set in Functions.php and Echo Them Inside My Custom Post Template
- Including Custom Post Type posts in a page template contextually (or should I widget?)
- Custom Blog Post Listing in Genesis Sample Child Theme
- Pull in custom content types into page template
- Editable content on a Custom Archive page
- Troubles with making a custom template for posts
- Creating a Page to View the List of Posts for a Custom Post Type?
- Change archive page template using pre_get_post
- Custom Page that comes with preloaded content for the user
- Custom-Posttype & Custom Taxonomy WP_Query
- Page template with different page and post content
- redirect automatic page that serves custom posttype content
- Adding sidebar to template creates horizontal gap the size of the side bar
- WordPress showing archive.php instead page
- Show Custom Post Type meta boxes only on Page Edit
- Creating a Page Template to display all items from a Custom Post Type
- Filter widget outputs
- Why does my content disapear when I make a page to match an archive name?
- Custom Post Type Template Alternative
- General advice on addressing content-centric pages
- Fields for different parts of a page
- Multiple templates for single custom post type
- How do you create a custom template to display a category with an image and related posts below?
- Pages Become “Archive” Instead of Using Page Template
- How can I set the page template of a new custom post type post?
- Multiple single templates?
- Custom URL redirect in WP
- WordPress Picks Up Wrong Template for Custom Post Type Archive Page
- Associate page w/ specific single post template?
- get comments by current user inside page template
- page template for custom post type
- How to integrate single and archive templates for custom post type in any WordPress theme
- Custom page for editing custom post type on frontend based on url
- Dynamic assign a custom template to custom post type posts
- How do I display child post types in the parent post type template
- How can I modify a custom post type and custom page template for a child theme if all content seams to be handled by theme’s ‘native’ plugin?
- How to add page under a custom post type?
- Custom permalink structure for remote content pages
- Display custom post type from template
- Problem with custom loop navigation inside the blog page
- WordPress giving me the index
- How to use pre_get_posts on archive page custom post type
- Can I automatically assign a page template to a custom post type (i.e page-slug.php file)
- Virtual page and loading template
- Custom Post type dont use custom page template (slug is not right)
- How to change Elementor Template for Single Page Post on Load
- A certain theme is forcing it’s singular post layout
- How to create additional rendering for custom post types?
- How do I find out which (page) template file my custom child post is looking for?
- Set a template on a custom post in the plugin
- How can I use a custom template to load custom post type posts based on a post_meta value
- How can I use one instance of page.php to display different custom post types?
- Question on templates
- Custom post type option page template
- Custom post Query and WordPress Post Query Clash
- How can I load Template file from wordpress plugin
- How to display a custom post as a page (but unedited)?
- How can I find out what template is my custom post type using?
- Search custom post type result in same template page
- Custom post type , page template not grabbing the page template
- WordPress custom post type and page
- Ordering Posts List By Taxonomy Terms?
- Loading a template for a URL pattern
- Custom Homepage As Single Page or Custom Post Type?
- custom post type archive slug vs. custom page template
- How to create a custom template for this custom post type?
- Nested custom post types templating
- Custom Post Type & Page Template
- How to divide posts (custom post type) content on multiple pages?
- How do I paginate a custom post type listing on a custom template page?
- Custom Post Type order Title ASC
- get tags from custom post type
- Page template anomaly
- Custom Post Type Template Based on Page Slug?
- I want to show a list of posts under specified categories
- I want to show a list of post with title that have link goes to that post and icon under the specific category to which it belongs