WP Smith

Creating WordPress & Genesis Websites Since 2010

  • Home
  • About
  • Services
  • Blog
  • Contact

Apr 09 2011

Creating "Unbreakable" Genesis Child Themes for Clients

So, one of the things, I started doing was "protecting" my child themes by moving everything out of functions.php. I create a folder called lib or custom with a file called functions.php (contains various functions) and/or child-setup.php (contains things like registering custom post types, custom taxonomies, meta boxes, registering/unregistering layouts/sidebars, theme support, image sizes, and site-wide changes like the moving or removing of post meta/breadcrumbs, etc.).

Then in my functions.php file, I add a few require_once statements with important titles and a death warning not to remove any of these statements. So a theme functions.php may look like:

[php]<?php
/********************************************************************************/
//DO NOT EDIT! EDITING THIS SECTION CAN HAVE SERIOUS RAMIFICATIONS!
// Start the engine
require_once(TEMPLATEPATH.'/lib/init.php');
//Start Child Theme engine
require_once(STYLESHEETPATH.'/lib/init.php');
//Custom Child Theme library
require_once(STYLESHEETPATH.'/custom/custom-footer.php');
require_once(STYLESHEETPATH.'/custom/child-setup.php');
require_once(STYLESHEETPATH.'/custom/functions.php');
/********************************************************************************/
//Add any extra functions, below here! Enjoy!

[/php]

Are there any tricks that you use?

Written by Travis Smith · Categorized: Genesis

StudioPress Premium WordPress Themes     WP Engine Managed WordPress Hosting

What can I do for you!?

Custom Development

We develop plugins by determining both business/functional and technical requirements, following WordPress development best practices, and using agile methodology to ensure you get the best solution.

Consulting

Have questions? Need a reliable developer to consult? Please contact us today!

Customized Theme

We can customize your theme or child theme, or create a child theme for you based on your needs while enhancing the performance of every individual attribute.

Customized Plugin

We can customize your plugins, extend plugins (e.g., Gravity Forms, Jetpack, Soliloquy) based on your needs ensuring security, performance, and positive business impact.

Contact Us

About Travis Smith

As a WordPress enthusiast, developer, and speaker, Travis writes about what he learns in WordPress trying to help other WordPress travelers, beginners and enthusiasts with tutorials, explanations, & demonstrations.

Comments

  1. Bruce says

    April 10, 2011 at 9:05 am

    Never thought of this. I just add changes directly to the child theme functions.php file. Your method does isolate customizations, but I can’t see other benefits?

    Another thing I have done is in create a plugin file and name it something like Custom Functions. In that file I keep all functions needed to customize the admin area (header, footer, custom favicon, breadcrumbs, unregister widgets, hide wp reminder, change howdy greeting, disable dashboard widgets, add custom dashboard widgets, change contact methods in user profile, add a ‘client; custom role (use Members plugin to administer), and more).
    This saves time in setting up a new install, and optimizes the admin (consistently are for clients.
    When I find something new, I add it to the plugin file.
    Hope this helps!

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Twitter
  • Facebook
  • LinkedIn
  • Google+
  • RSS

Copyright © 2025 � WP Smith on Genesis on Genesis Framework � WordPress � Log in