You should register the post type from the old theme, all the posts are still there in the database WordPress just doesn’t know to look for them.
Use the register_post_type with the same slug/post type name, and your old portfolio posts will reappear, no need to detach and re-attach to new pages
Related Posts:
- Creating a metabox to upload multiple images, Ignoring The Featured Image
- How to Removing fields from the Media Uploader/Gallery on a Custom Post Type Edit Page
- Duplicate Custom Header Functionality into the post edit screen
- Media library – Limit images to custom post type
- Correct Post Count ( All | Published | Drafts | Pending | Trash ) for Custom Post Type when restricting to view own posts
- How to hide CPT files from media library programmatically
- Add metabox with media uploader in a custom post type [duplicate]
- How do I add media to a custom post type?
- How to make a page template to list all galleries?
- Too much recursion error when chosing image from image library for two different meta boxes in one post
- Using Default WordPress Custom Header Image Crop Feature in a Post Type / MetaBox
- Image size filtering in Media uploader according to custom post type
- Should I use custom post types for a front page video feature (vimeo)?
- How do I organize photos for multiple galleries?
- Delete all associated media when custom post type removed
- Remove fields on media uploader for custom page type – not working for “From Computer” or “From Url” tabs?
- Force documents to appear in Featured Image dialogue
- how to get URL of media uploaded to WordPress via media_handle_sideload()
- uploading images to specified directories
- WordPress 3.5 Media Uploader – Only allow 1 upload and certain file types
- Hide editor while keeping add media button in custom post type
- File sharing platform for user contributions? [closed]
- Cannot upload featured image to a custom post type
- Custom Attachment Type
- Insert into post button missing on custom post type
- Save data is post using php front end
- Attaching more than 1 parent (Post) to a media file
- Help Adding filter to Add Media button for custom post type
- Cant move file after media_handle_upload
- Custom post type media upload error with custom user role
- Custom post type Featured Image popup not working
- upload image with rest API to the media library
- Get the first post term
- How to prefix post permalinks with /blog/ – without affecting custom post types?
- Custom Post Type Plugin: Where Do I Put The Template?
- Add Category Taxonomy Support to Custom Post Type
- Disable permalink on custom post type
- Create an Info/Help message at top of a custom post type
- If is custom post type archive page
- Registering custom taxonomy with unique name, a good practise?
- custom post type and custom taxonomy permalink
- get_query_var() not working in pre_get_posts
- WP_Query ignores post_type in category view
- When we register a custom taxonomy or post type, does the WP database modified at all?
- Category as Class for Custom Post Type
- Post Type only showing for “Admin” under “Appearance” > “Menus”
- How do I create multiple post types in same menu section in WP-admin?
- automatically placing custom post types singles into submenu of main nav menu
- Custom Post Type Archive URL takes over page URL
- How to get search results in the backend admin on a custom post type?
- WordPress Search documentation: how to improve search query using taxonomy terms, custom meta fields?
- How can you make permalink work for custom post type and taxonomy?
- Adding An Author Tag To Posts Automatically
- Count custom post types with a specific meta value
- Query for posts from any post type but only add instock products
- WP insert post PHP function dynamically generated Custom Fields
- Query not returning CPT posts
- Change Post Title Edit Box
- Unable to display multiple post types in same query (WPML WP_Query)
- Parent a CPT to a page
- Add multiple custom post types in functions.php, but only one custom post type show in dashboard
- Add the .html extension to custom post types
- Inserting data into `post meta` table?
- Disable feeds for specific custom post types
- After deleting a post are terms, and custom meta deleted?
- How to use custom post type APIs, but use a different db table
- Show metabox in custom-post-template depending on taxonomy term?
- Control Custom Post Type template from a plugin
- WordPress User Roles, Custom Post Types, and Admin views
- 1 day after custom date change post status to draft
- WP_Query that filters based on custom relationship field
- remove child post from custom post type archive
- Programmmatically adding a Custom Post
- How would I create a shortcode to display a custom post within a page or regular post?
- Multiple content sections on a custom post
- Unable to get paginate_links working with a custom query [duplicate]
- Different permalink for CPT and regular Posts/Pages but why?
- Custom Taxonomy term archive template
- Trying to add script to specific admin page is not working
- Permalink Structure CPT With Custom Taxonomy Fails
- Use post as category
- Populate Custom Fields in a Custom Post Type?
- Display post meta on edit page in admin
- Enqueueing scripts and styles multiple CPTS
- Multiple portfolios and single item in two of them (ideas?)
- Randomize Posts. Skip the first post in ascending order
- Dynamic template for single custom post
- Cron job for creating posts not excecuting properly
- Unable to get Custom Plugin Options data
- How to get the upcoming post ID from front end?
- How can I display my custom posts type in a monthly calendar view?
- Display custom post type category, while in a CPT category, then the posts beneath
- WP-ADMIN – Listing all CPT in “posts” listing
- How to have this permalink structure: post_type/postname/custom_inner_page
- Additional section in custom post type permalink
- Disable closing on metaboxes
- Static page determines as home, but it is not
- Using a custom post type for an RSS feed only
- Edit Custom Post Type on Custom Admin Page instead Post Admin
- Use the same date-based permalink structure for all post types