Published on

Published in: Technology, Business
  • Be the first to comment


  1. 1. WordPress Parent/Child Themes by Lloyd Africa
  2. 2. Agenda <ul><ul><li>Introduction to themes </li></ul></ul><ul><ul><li>Creating a child theme </li></ul></ul><ul><ul><li>Need more from your child theme? </li></ul></ul><ul><ul><li>Benefits of themes </li></ul></ul><ul><ul><li>Theme Frameworks </li></ul></ul><ul><ul><li>Example – Thematic </li></ul></ul><ul><ul><li>Lessons Learnt </li></ul></ul>
  3. 3. Introduction  What is a Theme? Themes Themes are made up of a collection of PHP templates, CSS, Images, and JavaScript files, bundled together in a single directory, located in the WordPress themes directory [ wp-content/themes ]. Any theme that is extended is known as a PARENT. All the themes born from this parent are know as CHILD themes. Child Themes A child theme is a reference to a parent theme and all that is needed is a single style sheet [ style.css ]. You can optionally add your own templates or functions to customize the markup that the theme produces but essentially, style.css, is all WordPress requires you to define A Theme Framework is a solidly coded theme that serves as a base for other themes.
  4. 4. Creating a child theme &quot; We'll be working with the thematic framework which is assumed, downloaded, unzipped, and sitting in [wp-content/themes/ thematic ] &quot; Step 1  -  Create a new folder in [wp-content/themes/ YOUR-CHILD-THEME ] Step 2 -  Create a new file called style.css and put it into your newly created folder Step 3 - Open/Edit your style.css (which should be blank) and add in /* Theme Name:  YOUR-CHILD-THEME Description: Child Theme based on Thematic Author: Lloyd Africa Template: thematic /* this points to its parent and inherits ALL its functionality */ Version: 1.0 . This work is released under the GNU General Public License 2: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html . */ @import url(&quot;../ thematic /style.css&quot;); That's it!
  5. 5. Need more than CSS? &quot; If you need to change more than just the CSS and what to add in your own functions or display a unique favicon or do something funky then create a new functions.php and add this new file to  [wp-content/themes/ YOUR-CHILD-THEME ] &quot; Step 1  -  Open/Edit your functions.php (which should be blank) and add in <?php function childtheme_favicon() { ?>      <link rel=&quot; shortcut icon &quot; href=&quot; <?php echo bloginfo('stylesheet_directory') ?> /images/favicon.ico&quot;> <?php }   add_action(' wp_head ', ' childtheme_favicon '); /* your other funky code here */ ?> That's it!
  6. 6. Benefits of themes Standardization of themes will improve workflows and allow multiple developers and designers to add, edit, extend and design around a single known, community supported base theme (*framework). If you have a 1000 client sites and WordPress 5.0 is released, you'd potentially have to hunt through the code of a 1000 sites and multiple template files looking for stuff to  check, test and maybe even fix. If those clients are using child themes to skin a carefully coded parent theme and maybe added some custom HTML or PHP, your only concern would be the parent theme.  One Theme. 1000 Sites.
  7. 7. Theme Frameworks Sandbox http://wordpress.org/extend/themes/sandbox Carrington http://carringtontheme.com/ WP-Framework http://wpframework.com/ Hybrid http://themehybrid.com/themes/hybrid Thematic http://themeshaper.com/thematic/
  8. 8. Thematic Thematic is a WordPress theme framework, designed by Ian Stewart. It has 13 total widget areas and compatible with plugins such as Subscribe to Comments,  WP-PageNavi, and Comment-license.  It's free open source and users are able to  remove credit information through the  theme options page. It has a growing community following, support forums, commercial support and customization and is leading the wave of killer parent/child theme frameworks. Watch this space [                          ]
  9. 9. Lessons Learnt Themes are the future of WordPress &quot;skinning&quot; Moving forward it makes sense to work around an existing theme framework for WordPress and if you have the time and budget, to create your own theme framework. Its clear that the future of the current top 5 theme frameworks are well stable given their community support and increased following. These &quot;standards&quot; make development and designing easier and even simpler and once familiar with a 3rd party or custom theme framework, should see production time reduced potentially by half.