What happens to a Custom Template when theme is changed?
-
Hi,
I created a custom template using the Single template – copied it, and changed the allowable width for Featured Images. It’s used when I create a post which has a Featured Image of the portrait (vertical) perspective. That way, the Heiwa theme displays it both in the Index (grid) view, and as a normal size (not huge) image within the (modified template) Single view.
I’ve assigned many, many posts using this custom template, and it works great. However, as I continue to see WordPress introduce so many new, cool themes, it dawned on me…question: if I change themes, will this custom template vanish into the ether, along with the time it took to format so many posts?
I suspect that this is the case, and, if so, isn’t there some way for WP Devs to sandbox or store separately custom templates which users create or modify, which that would remain editable in a new, changed theme environment?
Thank you for your time.
The blog I need help with is: (visible only to logged in users)
-
Hi there,
Custom templates you create are theme-specific so they do not travel with you if you switch themes.
I suspect that this is the case, and, if so, isn’t there some way for WP Devs to sandbox or store separately custom templates which users create or modify, which that would remain editable in a new, changed theme environment?
Themes can be very different from one to the next both in their visual appearance but also in how they are organized and constructed at the template level. Because of this, it’s not really possible to generalize a template so that it can be used for many different themes.
That said, it is my understanding that developers are considering a way to trigger a specific template based on a tag or category you are using. Also it can be the case that some themes will handle vertical or horizontal images equally well (or can be customized to do so within a single template) so if you are interested in a specific theme we can take a closer look and see how it would interact with your current content.
Thanks for the additional info!
-
Thanks very much for your reply.
The potential in allowing for a tag to trigger a specific template does sounds very helpful, particularly as regards the display of different sized Featured Images, with the possibility of batch (rather than individual) post-assignments.
-
Whoops…almost forgot my question: that is, given that I have the aforementioned custom template currently in use with the Heiwa theme, suppose I decided to activate a different theme. If I were to later return to use the Heiwa theme, again, will that custom template still be in place as presently assigned?
Thanks again.
-
Hi again,
If I were to later return to use the Heiwa theme, again, will that custom template still be in place as presently assigned?
In my tests the answer is yes, but with a big caveat. I only switched to another theme, made no changes (under the new theme) and then changed right back. However, if you experiment with the new theme, or try 2 or more themes before switching back, the templates and/or their association to specific posts may not be retained.
If you like you can test this out though, buy creating another site under your account and exporting your content into it. If you activate the Heiwa theme on the site before you import into it, templates should be retained. From there you can experiment with different themes to your heart’s content, while leaving philperkins.photography exactly as it is.
You can start a new site (the free option would be sufficient for this test) anytime by visiting the following link: https://wordpress.com/start/
The potential in allowing for a tag to trigger a specific template does sounds very helpful, particularly as regards the display of different sized Featured Images, with the possibility of batch (rather than individual) post-assignments.
To future-proof yourself I do recommend using tags or categories (can be either) to start noting things like portrait vs landscape orientations. Or crop sizes like vertical, horizontal, square, pano, etc.
This will allow you to take advantage of triggering custom templates should that functionality arrive. Also it’s worth noting that you can view lists of posts by tag or category in the classic wp-admin view, and it has a bulk edit option: https://wordpress.com/support/pages/edit-pages-screen/#bulk-edit-publicize
You can bulk assign categories and/or tags, and even change the template that multiple posts use with a single edit. I’m not sure how many posts you have applied your custom template to, but you could use the bulk edit option to apply a new template if you switch to a new theme. There would still be manual work over a tag-triggered template option but it would be much faster than editing posts one at a time.
I hope this gives you some ideas to move forward!
- The topic ‘What happens to a Custom Template when theme is changed?’ is closed to new replies.