Although this blog is intended to primarily focus upon my watercolor artwork and the continual development of my fine art e-commerce website, occasionally I make a discovery while developing my other websites that I think my readers would find useful. The past week has revealed some great information that I wish to pass along.
Since I have formed an affection for the WordPress platform and its incredible array of features and plugins, I decided to completely rebuild the home beer brewing website from the ground up. The process went very smoothly and I chose to utilize WordPress’ Twenty Twelve default theme. I didn’t want to invest much money into the project since the site is filled with free information and isn’t an e-commerce entity.
The Twenty Twelve default theme conformed to all my necessary criteria and I found it very easy to modify the static page, header, and footer templates. I made some modifications to the theme’s Cascading Style Sheet (CSS) and my home brewing website was back in operation in under a week’s time. Incorporating a 301 redirect into a .htaccess file I uploaded to the old Comcast server space insured old users would find the new site. I also made sure to update all my Google Webmaster Tools information and my Bing Webmaster Tools data so my search engine rankings wouldn’t be too terribly impacted by the move.
After some thinking, however, I began to realize that if the WordPress default theme was ever updated as part of the entire WordPress installation, I would lose all the custom template work I had accomplished. This is something that already impacts my Powers Fine Art website and it is incredibly aggravating to need to continually modify files after a theme update occurs.
Some Internet investigation, however, revealed an interesting feature integrated into WordPress of which I was not previously aware. There is already a mechanism in place known as the child theme that was designed to prevent changes, modifications, and custom templates from being overwritten.
A child theme is essentially a folder created within the WordPress themes folder. It contains a required style.css file with some unique header information to indicate which theme it is modifying as well as any additional CSS modifications. The folder also contains the modified theme template pages which are used instead of the pages native to the original.
A standard WordPress folder hierarchy is depicted below:
themes (directory where all themes are stored)
theme-name (directory of an example parent theme)
theme-name-child (directory of child theme; can be named anything)
style.css (required file in a child theme; must be named style.css)