3 Definite Ways to Avoid Theme-Lock
I recently wrote about how WordPress users should avoid using theme-specific shortcodes because they create a theme-lockin effect that can be disastrous in the future if the user goes to switch themes. While theme-lock is not a difficult concept to understand, it is certainly a major issue and must be addressed for new and inexperienced users.
What is WordPress Theme-Lock?
Any inexperienced WordPress user who’s changed themes probably knows the symptoms of theme-lock. Before, you found a theme that seems totally awesome because it had tons of design features and a bunch of shortcodes that would allow you to do some really cool stuff. Then, for whatever reason, you decided to switch to a new theme. Maybe you like the design better, it offers some better features, etc. Whatever the reason, you uploaded the new theme, activated it, played with some of the settings, and voila! Finally, you go to preview your new theme on your site and it’s totally screwed up. You find a bunch of shortcodes scattered throughout your content that now don’t render what they used to, your custom content (i.e. Portfolio Items, etc.) has disappeared and your site is trashed because of it. This is a result of switching to a new theme when most of your website relied on the previous theme. You now realize that it may be easier to just switch back to your old theme rather than going through all of your pages and posts to switch/remove shortcodes, re-add your custom post types, etc. This, folks, is theme-lock.
How to Avoid Theme-Lock
I’m now going to give you a 3-point list of how to completely avoid theme-lock. This list gives you three methods to prevent the headache of theme-lock in the future.
Stop Using Functionality-Heavy Themes
Using a theme that comes with a ton of functionality is not a good decision. I totally understand that these types of themes sound great to non-technical users and seem to provide a great value. Themeforest has made a killing on these types of themes. However, they comprise the problem that is theme-lock. Eliminate the source by using a clean theme such as the Genesis Framework. Since Genesis doesn’t come with built-in custom post types or shortcodes (well, it has a few very useful ones), you are forced to use these things by means of a plugin. Putting these things in a plugin makes them portable and theme-independent (see below).
Learn Some HTML/CSS
By learning even the basics of HTML and CSS, you will be able to control the appearance and layout of your website much more than you thought was imaginable. You DO NOT need to be an expert programmer or even know any PHP to learn a bit of HTML and CSS. Check out w3schools for some excellent, free content or Treehouse if you want some high-quality, premium videos that test your knowledge. You should at least be familiar with basic HTML markup, creating and styling classes, and using basic CSS.
Keep All Functionality Theme-Independent
Plugins are for functionality, themes are for display. Live by that bit of knowledge when working with WordPress because it will make your life easier. To ensure that you never break this rule, ask yourself one simple question when you add something to your WordPress website: Do I want this to remain intact if I switch themes? If the answer is yes, then you need to be using a plugin.
So what plugins should you be using to move your site’s functionality away from themes? I’ve put together a list of plugins that do things commonly found in functionality-heavy themes. These plugins will let you rest easy knowing that your important functions and customizations move with you when you switch themes.
- Custom Post Types UI & Advanced Custom Fields – These two plugins are two of my all-time favorite plugins for WordPress. Custom Post Types UI lets users easily and quickly create unlimited custom post types without needing to mess around with PHP. Advanced Custom Fields lets you create unlimited custom fields for your WordPress posts. Together, these two plugins create a real powerhouse setup for creating any type of custom content.
- Essential Grid – This plugin is the best available for creating content grids. Content well suited for grids include portfolio items, blog posts, testimonials, products, galleries, and more. You can use it together with CPT UI and ACF to display your custom content in very elegant even-grid or masonry layouts. Essential Grid is flat-out amazing!
- Shortcodes UI – This free plugin lets users create their own shortcodes without needing to use PHP. If you have a lot of repetitive content, shortcodes are great to store it in. Why? If you ever need to make changes to that content (i.e. to change a price), you can make the change in one location (the shortcode) rather than in however many places that content is located. You can customize the HTML to your liking and store it in a simple shortcode that you can insert into any post. Although I hate theme-specific shortcodes, I’m not opposed to shortcodes in general because they can be great for things like this.
- Shortcodes Plugins – If you need to use design shortcodes to improve the experience for your site’s viewers, use a plugin. Although design shortcodes are more often seen in themes, there are plugins that give users a nice selection of shortcodes to enhance their website’s design. Here’s a good article listing some of the best free shortcodes plugins for WordPress.
There you go! You should now have a very good understanding of what WordPress theme-lock is and how to prevent it moving forward. If you have any questions, feel free to leave a comment below. Thanks for reading!