Original article – http://wpclips.net/safely-customizing-genesis-child-themes-wp-clips/
CUSTOMIZING GENESIS – A QUESTION OF ‘BEST PRACTICE’
Some time ago, I stumbled upon on a YouTube video entitled “How to Safely Customize Your Genesis Child Theme”, in which Katrinah (katrinah.com) explained how to customize Genesis child themes using secondary custom files to protect customizations from theme updates.
As a fellow Genesis user and third-party developer, I saw Katrinah’s tutorial as a helpful resource for the Genesis community. However, I recently happened upon the video again to find the original content removed and several comments taking issue with adding secondary files over editing theme files directly. StudioPress support also weighed in, stating that Best Practice is to edit theme files directly because Genesis child themes do not get updated.
Well, this might be true of StudioPress themes. However, many Genesis child themes DO get updated, in particular themes from third-party developers which integrate frequently-updated plugins (e.g. WooCommerce). And, plugin updates often necessitate theme updates.
BENDING THE RULES, NOT BREAKING THEM
So, in view of the little debate above, here are a few caveats up-front –
- WP Clips uses secondary custom files.
I believe there is good reason to abide by StudioPress’s Best Practice method. However, I also believe there is a place for adding secondary custom files, in particular for customizing Genesis child themes which offer updates or require ongoing customization.
- WP Clips is still extremely useful in combination with Best Practice.
There is really no issue with keeping custom code active within WP Clip‘s secondary files. However, if you choose to follow Best Practice, you can transfer your code back to the theme’s native files on completion. In this case, WP Clips offers both a helpful facility for massaging and testing your code, and an easily activated or deactivated back-up for your customizations.
- WP Clips is ideal for customizing with code.
At just 6kb in size, the starter plugin contains little more than a folder of empty files. It’s not intended to replace more intuitive customizers such as Genesis Extender or Design Palette Pro. However, if you want to dive into code and get your hands dirty, WP Clips offers a great outdoor playground while keeping your home neat and tidy.
PUTTING WP CLIPS INTO PRACTICE
So, you’ve installed your Genesis child theme and it’s time to start customizing. Well, here are some very simple steps:
- Download WP Clips from wpclips.net
Opt for the starter plugin. If you want to enable Precoded Clips in the future, you can always upgrade to WP Clips Plus without overwriting your custom files and code.
- Install and activate the plugin.
Don’t install as an mu-plugin (must use) during development. The ability to activate and deactivate the plugin can be useful for troubleshooting.
- Now, dive in and start customizing.
I won’t use this forum to expand on the how-to’s of customizing Genesis child themes. I’ll simply discuss in relation to WP Clips.
So, central to customizing with WP Clips are the custom files located in the /wp-content/plugins/wp-clips/clip/ directory – the custom Clip. These files include:
custom-functions.php – for custom PHP functions
custom-jquery.js – for custom jQuery scripts
custom-style.css – for custom CSS styles
You can add code and edit these custom files with your usual code editing software, or via the Plugins > Editor in WordPress admin (take the Clip Shortcut).
Personally, I do all my initial development on localhost with Adobe Dreamweaver, and then use CyberDuck (FTP) for customizing files on the fly.
- Life after customizing.
If you are comfortable keeping your customizations within the active Clip (my preference), then start celebrating. You’re done!
If, however, you wish to adhere to Best Practice, then carefully transfer the customizations across to your native theme files and simply deactivate the plugin. Leave it installed for future customizing and as a back-up should you ever need to restore or update the original child theme. Your customizations will be reinstated immediately upon reactivation.
This is the very practical advantage to using secondary custom files. You can always return to basecamp in seconds. It’s not so easy when your customizations are scattered throughout the theme’s native files.
A FEW TIPS
Additional files and content
You can add and enqueue any required files and content within the custom Clip folder (e.g. images or lib folders, jquery plugins). There’s really no limit to how you use the Clip.
Customizing native theme files
Sometimes, it just makes good sense to customize native files directly (e.g. templates). A log.txt plain text file is included within the Clip to record any such changes.
Power-up the Plugins > Editor
If you use the Plugins > Editor in WordPress admin, why not add some helpful features like syntax highlighting, line numbers and auto-complete. I suggest installing Bainternet’s Advanced Code Editor. It’s the ideal plugin partner to WP Clips.
The WP Clips plugin is itself translation-ready and includes a /languages/wp-clips.pot file. If leaving the custom Clip active, this file can be updated at any time with a simple translation plugin (e.g. Poedit) to include all translatable custom text.
Changing to a must use (mu-) plugin
After development, you may want to consider transferring the plugin folder contents (not the plugin folder) to a new or existing /wp-content/mu-plugins/ directory. This will block access to custom files and prevent plugin deletion via WordPress admin. A good final safeguard before hand-over to a client.
Don’t stress and have fun
As said before, WP Clips is like an outdoor playground for customizing Genesis themes. You can get your hands dirty, try new things, toss ideas in the air and see how they land, anything you like, always knowing that your fundamental theme remains unchanged.
Please check out the WP Clips website wpclips.net. There is plenty of documentation and FAQ’s on how the plugin works and how you can tailor WP Clips to fit your needs. Also, learn about WP Clips Plus, Precoded Clips and the new ClipBank™.
And remember, WP Clips is constantly being improved. So, please send us your feedback – maybe a new feature you’d like to see, or a different application you’ve discovered, or perhaps you’d simply like to weigh in on the ‘question of custom files’. Don’t be shy. Throw your comments our way!