SlideShare a Scribd company logo
1 of 13
Download to read offline
CHILD THEMES
              A WordPress child theme is a theme that inherits
              the functionality of another theme, called the
              parent theme, and allows you to modify, or add
              to, the functionality of that parent theme.

                         http://codex.wordpress.org/Child_Themes

     @JEFFREYZINN OF @PIXEL_JAR                             2012 · MAY · PASADENA · MEETUP
Monday, April 30, 2012
WHY USE A CHILD THEME

     ‣LEVERAGE THE FUNCTIONALITY OF THE PARENT THEME
     ‣BE ABLE TO CONTINUE UPDATING PARENT THEME

     ‣WILL NOT OVERWRITE YOUR CUSTOMIZATIONS

     ‣SPEED UP DEVELOPMENT TIME




     @JEFFREYZINN OF @PIXEL_JAR            2012 · MAY · PASADENA · MEETUP
Monday, April 30, 2012
PARENT                           CHILD
                   THEME                            THEME




     @JEFFREYZINN OF @PIXEL_JAR   #CHILDTHEMES   2012 · MAY · PASADENA · MEETUP
Monday, April 30, 2012
PARENT THEME: LUKE           CHILD THEME: YODA
                    • PILOT                    • [ALL OF LUKE’S ATTRIBUTES]
                    • WHINY                    • LIFT X-WING FROM SWAMP
                    • RUNS, JUMPS, FLIPS       • AGED WISDOM
                    • LIFT ROCKS AND R2-D2     • DELICIOUS SOUP
                    • LIGHTSABER
                    • [FUTURE IMPROVEMENTS]




     @JEFFREYZINN OF @PIXEL_JAR                                   2012 · MAY · PASADENA · MEETUP
Monday, April 30, 2012
PARENT THEMES vs. CHILD THEMES
     PARENT THEME                                         CHILD THEME
    • CAN BE ANY THEME                                    • INHERITS PARENT THEME FILES
    • REQUIRES:                                           • OVERRIDES PARENT SCRIPTS (if present)
      • index.php                                         • functions.php (amended to parent
      • style.css                                           functions.php)
                                                          • REQUIRES:
            /*
            Theme Name:    Twenty Eleven
                                                            • style.css (*not inherited)
            Theme URI:
            Description:
            Author:
                           http://example.com/
                           Description about this theme
                           Author name here
                                                                                                            required!
                                                             /*
            Author URI:    http://example.com/about/
                                                             Theme Name:    Twenty Eleven Child
            Version:       1.3
                                                             Theme URI:     http://example.com/
            */
                                                             Description:   Description about this theme
                                                             Author:        Child Author name here
                                                             Author URI:    http://example.com/about/
                                                             Template:      twentyeleven
                                                             Version:
                                                             */
                                                                            0.1
                                                                                                           parent folder
     @JEFFREYZINN OF @PIXEL_JAR                                                                    2012 · MAY · PASADENA · MEETUP
Monday, April 30, 2012
2012 · MAY · PASADENA · MEETUP




http://codex.wordpress.org/Template_Hierarchy
                                                @JEFFREYZINN OF @PIXEL_JAR
                                                                                 Monday, April 30, 2012
 WHICH TEMPLATE PAGE WILL WORDPRESS CHOOSE?
HYPOTHETICAL SITUATION
           WE VERY MUCH LIKE THE TWENTY ELEVEN THEME, EXCEPT WE ABSOLUTELY
           NEED TO MAKE THE FOLLOWING CHANGES:
           ‣ NEED THE STYLESHEET TO HAVE SOME DIFFERENT RULES (blue nav)

           ‣ NEED A SPECIAL TEMPLATE PAGE FOR ONE PARTICULAR CONTENT PAGE (no title on about
              us page)
           ‣ NEED TO REVISE THE WAY A SINGLE POST DISPLAYS (remove prev/next links)

           ‣ ADD FILTER FUNCTION (modify the_content() )




     @JEFFREYZINN OF @PIXEL_JAR
Monday, April 30, 2012
THEME FILES




     @JEFFREYZINN OF @PIXEL_JAR
Monday, April 30, 2012
CHILD THEME CSS FILE (does not inherit parent styles)
           TWO OPTIONS:
           ‣ ADD IMPORT CALL TO PARENT STYLESHEET; ADD CUSTOMIZATIONS AFTER IMPORT

           ‣ COPY/PASTE PARENT STYLESHEET INTO CHILD STYLESHEET; CUSTOMIZE AS NECESSARY


             /*
             	

 Theme Name: Twentyeleven Child Theme
             	

 Template: twentyeleven
             */

             /* Either import parent style.css file or copy/paste styles */
             @import url("../twentyeleven/style.css");


     @JEFFREYZINN OF @PIXEL_JAR
Monday, April 30, 2012
CHILD THEME functions.php (does inherit parent functions)
           ‣ ONLY CREATE IF NECESSARY

           ‣ ADD NEW FUNCTIONALITY TO CHILD functions.php PAGE


             <?php

             add_filter( 'the_content', 'my_special_instructions' );
             function my_special_instructions( $content ) {
               ...
               return $content;
             }

             ?>

     @JEFFREYZINN OF @PIXEL_JAR
Monday, April 30, 2012
CHILD THEME SCREENSHOT/THUMBNAIL
           ‣ ADD screenshot.png TO YOUR CHILD THEME FOLDER

           ‣ WIDTH: 300px; HEIGHT: 225px




     @JEFFREYZINN OF @PIXEL_JAR
Monday, April 30, 2012
CHILD THEME CUSTOM FILES
           ‣ style.php (theme identity and custom styles)

           ‣ functions.php (add in a filter function)

           ‣ page-66.php (special template for about page)

           ‣ single.php (remove prev/next links)

           ‣ screenshot.php (sweet thumbnail for admin)




     @JEFFREYZINN OF @PIXEL_JAR
Monday, April 30, 2012
The End. Thank You. Any Questions?
     https://github.com/jeffreyzinn/pasadena-wp-may-2012-child-theme

                           http://codex.wordpress.org/Child_Themes

                         http://codex.wordpress.org/Template_Hierarchy

                                  TWITTER                  WEB


                         JEFFREYZINN@PIXELJAR.NET
                                              EMAIL

     @JEFFREYZINN OF @PIXEL_JAR
Monday, April 30, 2012

More Related Content

Viewers also liked

Viewers also liked (17)

עוז לתמורה - מפגש עם רן ארז בישוב לקיה
עוז לתמורה - מפגש עם רן ארז בישוב לקיהעוז לתמורה - מפגש עם רן ארז בישוב לקיה
עוז לתמורה - מפגש עם רן ארז בישוב לקיה
 
Письмо букв по Илюхиной
Письмо букв по ИлюхинойПисьмо букв по Илюхиной
Письмо букв по Илюхиной
 
Что это за листья
Что это за листьяЧто это за листья
Что это за листья
 
Письмо букв Рр
Письмо букв РрПисьмо букв Рр
Письмо букв Рр
 
Heroes
HeroesHeroes
Heroes
 
Согласные звуки р, рь, Буквы Рр
Согласные звуки р, рь, Буквы РрСогласные звуки р, рь, Буквы Рр
Согласные звуки р, рь, Буквы Рр
 
Kohti parempaa kuluttajuutta
Kohti parempaa kuluttajuuttaKohti parempaa kuluttajuutta
Kohti parempaa kuluttajuutta
 
μικρος πριγκιπας παρουσιαση
μικρος πριγκιπας παρουσιασημικρος πριγκιπας παρουσιαση
μικρος πριγκιπας παρουσιαση
 
מהו צדק עברית
מהו צדק עבריתמהו צדק עברית
מהו צדק עברית
 
Pertemuan 1
Pertemuan 1Pertemuan 1
Pertemuan 1
 
Excel Chapter 03
Excel Chapter 03Excel Chapter 03
Excel Chapter 03
 
Столько же больше меньше
Столько же больше меньшеСтолько же больше меньше
Столько же больше меньше
 
Fotos para la historia
Fotos para la historiaFotos para la historia
Fotos para la historia
 
Digital Business: Virtual Services
Digital Business: Virtual ServicesDigital Business: Virtual Services
Digital Business: Virtual Services
 
Pertemuan 10
Pertemuan 10Pertemuan 10
Pertemuan 10
 
Janesh b'day ppt
Janesh b'day pptJanesh b'day ppt
Janesh b'day ppt
 
Pertemuan 11
Pertemuan 11Pertemuan 11
Pertemuan 11
 

Similar to Child Themes Pasadena WordPress Meetup May 2012

WordPress Child Themes
WordPress Child ThemesWordPress Child Themes
WordPress Child ThemesAlison Foxall
 
WordPress Child Themes
WordPress Child ThemesWordPress Child Themes
WordPress Child Themesopenchamp
 
Writing a WordPress Theme - HighEdWeb 2013 #WRK2
Writing a WordPress Theme - HighEdWeb 2013 #WRK2Writing a WordPress Theme - HighEdWeb 2013 #WRK2
Writing a WordPress Theme - HighEdWeb 2013 #WRK2Curtiss Grymala
 
Parent and child themes
Parent and child themesParent and child themes
Parent and child themesTom Jenkins
 

Similar to Child Themes Pasadena WordPress Meetup May 2012 (6)

WordPress Child Themes
WordPress Child ThemesWordPress Child Themes
WordPress Child Themes
 
WordPress Child Themes
WordPress Child ThemesWordPress Child Themes
WordPress Child Themes
 
WordPress Child Themes
WordPress Child ThemesWordPress Child Themes
WordPress Child Themes
 
Writing a WordPress Theme - HighEdWeb 2013 #WRK2
Writing a WordPress Theme - HighEdWeb 2013 #WRK2Writing a WordPress Theme - HighEdWeb 2013 #WRK2
Writing a WordPress Theme - HighEdWeb 2013 #WRK2
 
Child Theme
Child ThemeChild Theme
Child Theme
 
Parent and child themes
Parent and child themesParent and child themes
Parent and child themes
 

Recently uploaded

BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 

Recently uploaded (20)

BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 

Child Themes Pasadena WordPress Meetup May 2012

  • 1. CHILD THEMES A WordPress child theme is a theme that inherits the functionality of another theme, called the parent theme, and allows you to modify, or add to, the functionality of that parent theme. http://codex.wordpress.org/Child_Themes @JEFFREYZINN OF @PIXEL_JAR 2012 · MAY · PASADENA · MEETUP Monday, April 30, 2012
  • 2. WHY USE A CHILD THEME ‣LEVERAGE THE FUNCTIONALITY OF THE PARENT THEME ‣BE ABLE TO CONTINUE UPDATING PARENT THEME ‣WILL NOT OVERWRITE YOUR CUSTOMIZATIONS ‣SPEED UP DEVELOPMENT TIME @JEFFREYZINN OF @PIXEL_JAR 2012 · MAY · PASADENA · MEETUP Monday, April 30, 2012
  • 3. PARENT CHILD THEME THEME @JEFFREYZINN OF @PIXEL_JAR #CHILDTHEMES 2012 · MAY · PASADENA · MEETUP Monday, April 30, 2012
  • 4. PARENT THEME: LUKE CHILD THEME: YODA • PILOT • [ALL OF LUKE’S ATTRIBUTES] • WHINY • LIFT X-WING FROM SWAMP • RUNS, JUMPS, FLIPS • AGED WISDOM • LIFT ROCKS AND R2-D2 • DELICIOUS SOUP • LIGHTSABER • [FUTURE IMPROVEMENTS] @JEFFREYZINN OF @PIXEL_JAR 2012 · MAY · PASADENA · MEETUP Monday, April 30, 2012
  • 5. PARENT THEMES vs. CHILD THEMES PARENT THEME CHILD THEME • CAN BE ANY THEME • INHERITS PARENT THEME FILES • REQUIRES: • OVERRIDES PARENT SCRIPTS (if present) • index.php • functions.php (amended to parent • style.css functions.php) • REQUIRES: /* Theme Name: Twenty Eleven • style.css (*not inherited) Theme URI: Description: Author: http://example.com/ Description about this theme Author name here required! /* Author URI: http://example.com/about/ Theme Name: Twenty Eleven Child Version: 1.3 Theme URI: http://example.com/ */ Description: Description about this theme Author: Child Author name here Author URI: http://example.com/about/ Template: twentyeleven Version: */ 0.1 parent folder @JEFFREYZINN OF @PIXEL_JAR 2012 · MAY · PASADENA · MEETUP Monday, April 30, 2012
  • 6. 2012 · MAY · PASADENA · MEETUP http://codex.wordpress.org/Template_Hierarchy @JEFFREYZINN OF @PIXEL_JAR Monday, April 30, 2012 WHICH TEMPLATE PAGE WILL WORDPRESS CHOOSE?
  • 7. HYPOTHETICAL SITUATION WE VERY MUCH LIKE THE TWENTY ELEVEN THEME, EXCEPT WE ABSOLUTELY NEED TO MAKE THE FOLLOWING CHANGES: ‣ NEED THE STYLESHEET TO HAVE SOME DIFFERENT RULES (blue nav) ‣ NEED A SPECIAL TEMPLATE PAGE FOR ONE PARTICULAR CONTENT PAGE (no title on about us page) ‣ NEED TO REVISE THE WAY A SINGLE POST DISPLAYS (remove prev/next links) ‣ ADD FILTER FUNCTION (modify the_content() ) @JEFFREYZINN OF @PIXEL_JAR Monday, April 30, 2012
  • 8. THEME FILES @JEFFREYZINN OF @PIXEL_JAR Monday, April 30, 2012
  • 9. CHILD THEME CSS FILE (does not inherit parent styles) TWO OPTIONS: ‣ ADD IMPORT CALL TO PARENT STYLESHEET; ADD CUSTOMIZATIONS AFTER IMPORT ‣ COPY/PASTE PARENT STYLESHEET INTO CHILD STYLESHEET; CUSTOMIZE AS NECESSARY /* Theme Name: Twentyeleven Child Theme Template: twentyeleven */ /* Either import parent style.css file or copy/paste styles */ @import url("../twentyeleven/style.css"); @JEFFREYZINN OF @PIXEL_JAR Monday, April 30, 2012
  • 10. CHILD THEME functions.php (does inherit parent functions) ‣ ONLY CREATE IF NECESSARY ‣ ADD NEW FUNCTIONALITY TO CHILD functions.php PAGE <?php add_filter( 'the_content', 'my_special_instructions' ); function my_special_instructions( $content ) { ... return $content; } ?> @JEFFREYZINN OF @PIXEL_JAR Monday, April 30, 2012
  • 11. CHILD THEME SCREENSHOT/THUMBNAIL ‣ ADD screenshot.png TO YOUR CHILD THEME FOLDER ‣ WIDTH: 300px; HEIGHT: 225px @JEFFREYZINN OF @PIXEL_JAR Monday, April 30, 2012
  • 12. CHILD THEME CUSTOM FILES ‣ style.php (theme identity and custom styles) ‣ functions.php (add in a filter function) ‣ page-66.php (special template for about page) ‣ single.php (remove prev/next links) ‣ screenshot.php (sweet thumbnail for admin) @JEFFREYZINN OF @PIXEL_JAR Monday, April 30, 2012
  • 13. The End. Thank You. Any Questions? https://github.com/jeffreyzinn/pasadena-wp-may-2012-child-theme http://codex.wordpress.org/Child_Themes http://codex.wordpress.org/Template_Hierarchy TWITTER WEB JEFFREYZINN@PIXELJAR.NET EMAIL @JEFFREYZINN OF @PIXEL_JAR Monday, April 30, 2012