0

I'm looking to redevelop this client’s site, and I’m in the process of sourcing a new theme. We developed the existing site using Modernize theme from Goodlayers, which is about 5 or 6 years old now.

The client creates video content, so his portfolio index grid page of projects (currently here​) will become the homepage and would still need to be displayed as a filterable (by category) grid.

Primary Issue:

In addition to sourcing a new theme, I need to decide how the new site manages new and existing custom post types (CPT’s) for portfolio items. Will these be provided by the theme itself or by a plugin (e.g. https://en-gb.wordpress.org/plugins/custom-post-type-ui/)? My concern is that if they are managed by the theme, I will have this same issue (of migrating existing CPT content) that I currently have when I need to switch themes in another 5 or 6 years. So is it prudent to move portfolio CPT’s away from being theme controlled to being plug-in controlled? Your thoughts on this are appreciated.

Secondary Issue:

I need some good advice on mapping existing site portfolio CPT’s to the portfolio CPT that will come with the new theme (or plugin generated portfolio CPT). I’ve already started experimenting here. I’ve cloned the site and have it in MAMP on OSX. I’ve tested uploading new themes that support/offer portfolio CPT’s and can apply them to the site OK, but I then don’t see my old/existing Portfolio items (from Modernize theme) available anymore.

Part of the problem I’ve discovered is that the previous theme (Modernize) had post_type=portfolio whereas a new theme may have post_type=portfolio-item (I.e. they have different post-type)

I’ve been building WP site’s for many years but don’t often get to do a theme switch where some of the existing content are CPT’s. I assume I’m experiencing the same issue found here:

Consequently, I’ve invested in an import/export plugin (https://codecanyon.net/item/wordpress-awesome-import-export-plugin-v-24/12896266) that claims to assist in migrating data between post types. I’ve had some success with getting the title, content and featured image between the old portfolio CPT and the new one in the theme, but it looses the Portfolio CPT taxonomies and the video URL. If the Modernize portfolio CPT's had a field for the video URL, do I have to find a theme with a portfolio CPT that also has a video URL field to map the data to? Or should I be using a plugin to create and manage the portfolio custom post type in the new theme, and that way avoid this problem in the future if I ever need to switch themes again?​

Appreciate your thoughts and advice on how I move forward with this project. I (& client) would rather avoid recreating ~90 portfolio CPT's due to time involved and hence cost, so if we could automate/script this somehow it would be preferred.

1
  • 1
    It's pretty easy to hop into phpmyadmin and change all posts where post_type=portfolio to post_type=portfolio-item - the question may be around the postmeta that said CPTs contain. Your question is rather broad for this site but your instinct that moving CPTs to a plugin is a more sustainable approach. However again with postmeta, you may still need to child theme any theme they switch to, it just depends on the exact setup.
    – WebElaine
    Commented Apr 5, 2018 at 12:52

1 Answer 1

0

As @WebElaine says, you can just change the post type directly in MySQL. Any post meta is mapped purely by post ID, so will all still be attached to the right posts.

Custom taxonomy terms should still be attached and if you register a taxonomy with the same internal name as your old theme used (look in its code for the register_taxonomy call) then you ought to see the terms magically reappear.

Similarly if you look in the post meta SQL table you ought to be able to find the meta key used for the video ID fairly easily and could either edit the database to use a meta key of your own choice or just carry on using the same key.

Essentially, my approach would be to use these steps as the starting point of your own small plugin for this portfolio post type, separating the functionality from the theme as you suggest you'd like to do for future robustness.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.