Custom post types don’t need a template created for them. They will automatically use the archive.php and single.php of your theme. If you want to customize a page so that your portfolio and your regular blogs are different then you need to create 2 files.
archive-postname.php (in this case it’s whatever you named your post type ie “portfolios”) This loads the archive page of your cpts or the roll, basically the list of all your posts on one page. You would get to it by going to www.example.com/portfolios/ (or whatever you’ve set your posttype to be)
then you have your single-postname.php
this loads the post detail or single view. this is what someone would see if they went to www.example.com/portfolios/cool-project-1
This is based on a few things. I’m assuming your post type is exactly portfolios, and that you don’t have an slug redirects etc. It’s also assuming that in settings/permalinks you have set to %postname%.
Related Posts:
- Query custom post type by custom field
- Filtering a WP_Query meta_query by numeric values isn’t working
- Automatically fill custom field value on post publish/update
- Filter a custom field based on selection of another custom field (ACF) [closed]
- ACF Relationships in Custom Post Type Permalink
- How to sort a table of custom posts by column containing custom field
- WordPress Search documentation: how to improve search query using taxonomy terms, custom meta fields?
- Use Custom Post Type as Custom Field
- Query by 2 values of a repeater ACF field
- Comparing timestamps in meta query doesn’t work
- Display two post types ordered by two custom fields
- WP insert post PHP function dynamically generated Custom Fields
- Having trouble with custom date field for CPT query (WordPress)
- Display posts if a custom field value is equal to another custom field value
- ACF Upload Image in repeater from front-end with custom form? – add_post_meta()
- Get Custom Field Values by Another Custom Field in WordPress
- How to Display ACF Relationship Custom Field as Link to Specific Custom Post?
- Sort posts based on multiple custom fields
- Query Custom Post Types by date (custom field) range
- Conditional to modify query results
- query posts and custom post type with meta key
- Custom Post type and Custom Field WP_Query
- How to change post featured image using a custom field of category?
- Retrieve value of a category’s custom field
- How can I dynamically add a post to a custom post type which uses a custom field?
- Querying Two Custom Post Types with OR Not Working
- Bulk Update Custom Fields for Custom Post Types
- WP_Query order by custom field, then randomly order some of results
- Query custom post type with ACF Date
- Meta Query Not Returning Output Despite Having Matching Values
- ACF From & To Date Validations
- Using advanced custom fields from one custom post type in another custom post type / using nested shortcodes
- How to render a custom post type template with custom fields using shortcode
- Order Custom Post Type by Custom Field Value
- Custom fields (wp_post_meta) vs Custom Table for large amount of data
- First custom field value (out of several) displayed twice after query
- Multiple Frontend Filters Using Advanced Custom Fields
- Integrate Custom Post Type Events into Calendar
- Displaying custom field according to date
- WebP Fallback for Inline Background Image in Style Attribute
- Query based on custom fields start and end date
- How to get a custom type post data when it has a connection with another custom type post?
- List of users that clicked a ‘Join’ button at single post
- How to conditionally add Custom Post Type to Front Page
- How to inherit field value from parent post into in child / sub post
- Custome fields not displayed
- Display a post from custom post type only if all the selected taxonomies and custom field value matches the record
- Custom Query: If One Post Object Field Value Is The Same As Another
- posttype and custom fields on multisite
- How do I get_the_postID() for a custom post that uses ACF repeater field?
- How do I replace the post title with a custom field?
- Sum and count of custom field values
- Group by custom field value (start and end times)
- Custom post types, disable fields
- Filtering custom posts by custom fields (ACF) [closed]
- Get A Custom Field From A Custom Taxonomy Of A Custom Post Type [closed]
- Excerpt length: get first paragraph
- Having a repeating custom field in admin custom post type, what I’d go better with, for DB’s sake? ACF repeater or query a different post type?
- ACF – Retrieve custom taxonomy from a relationship field
- Query filter by value in meta_value array
- Create if else for post types in WP_Query ‘post__in’ values
- WP Query from two Custom Post type fields as statement
- Using OR relation in meta_query to check for a value before sorting by another
- Meta query and compare “!=” not working as expected
- Display Custom Field or Custom Taxonomy in front page /post/product
- How to access repeater field of a custom field?
- Filter posts by their related field’s custom field
- How do I query with multiple custom fields orderby in same column?
- filter using custom fields
- How to hide sub fields in a field group and also the entire field group if the answer selected is “no”
- Autofill advanced custom field with user data
- Advanced search form with multiple custom fields
- Linking posts together with Advanced Custom Fields “both ways”
- Fixed custom fields depending on posttype/category
- Automatically convert standard posts with custom fields to custom post types
- Show first posts with custom field not empty and order all by title
- Can’t pick up a field created with Advanced Custom Fields
- Get month and day from a Date Picker custom field
- $post breaking container loop
- Setting a custom $query->query_vars[‘meta_key’] breaks the WordPress menu
- If i have custom post type with 5 custom fields do i have to create a new loop to reference each one?
- Filter CPT based on meta box value using Flexible Posts widget?
- How to show animal lineage/pedigree in WordPress?
- How to grab data (titles, thumbnails and custom fields) from multiple posts to populate a new array efficiently?
- Filter Custom post type by another Custom post type
- ACF – Query relationship without ID
- Retrieve a post with its ACF repeater fields in wordpress
- Get Posts ordered by a date custom meta field
- Is it possible to specify a time interval (from, to) in ACF with date picker, or other custom field?
- Display ACF object field data using Elementor Custom Query
- Post object GUID adding http:/
- Custom Sort Order for Custom Post Type Taxonomy
- wordpress plugin error handling
- Is there any performance consideration when using Custom Post Types?
- Querying Term Posts in Loop
- don’t publish custom post type post if a meta data field isn’t valid
- Query multiple taxonomies with pre get posts
- A meta box (in a custom post type) with two different type of fields
- What is the correct way that when creating a custom post type assign values to custom fields created with pods framework?
- Copying custom field value in to title