SlideShare uma empresa Scribd logo
1 de 28
GenesisWP from 10,000 feet
Trisha Cornelius
@trishawebs
Overview
What’s a theme framework
Why use the Genesis Theme Framework
Some #GenesisWP sites
Overview of the Genesis Framework
Developing a Genesis child theme
Helpful Resources
Things to look out for
What’s a theme framework?
“A framework is a solidly coded theme that should serve as a base for other
projects.” - Justin Tadlock
The codex identifies three types of frameworks:
1. A “drop-in” code library that is used to facilitate the development of a
theme. (e.g. Hybrid Core)
2. A parent theme designed to be modified (e.g. Genesis)
3. Any WordPress theme that is used as the base for another theme.
What’s a theme framework? (continued)
Parent and child themes were introduced in version 2.7 of WordPress.
A child theme modifies the way a parent theme looks and / or functions
without changing the code in the parent theme’s files.
There are two models for framework development:
1. The template model
2. The hooks model
What’s a theme framework? (continued)
The template model works by overwriting the parent theme’s files of the same
name.
As such template child themes may have their own:
index.php
single.php
header.php
footer.php
etc
What’s a theme framework? (continued)
The hooks model uses concepts similar to plugin development and modifies
the parent theme’s files without overwriting them.
These types of child themes will typically only consist of
functions.php
style.css
screenshot.png
This is the model that the Genesis Framework uses.
What’s a theme framework? (continued)
The child theme’s css is loaded after the parent theme’s css giving it’s style
precedence.
The child theme’s functions.php file adds to the parent theme’s functions.
If the child theme has a file of the same name as the parent theme, the child
theme’s file has precedence. (This is where the template model comes in).
Why use a child theme?
Take advantage of parent theme updates without losing the customization.
Customize a theme quickly and easily.
Don’t repeat yourself. Update the parent theme in accordance with evolving
best practices and push it across to all your child themes.
Continuous improvement (of the developer and of best practices).
What are the requirements of a theme framework?
Good documentation
Base code must be solid and in line with best practices
Good use of action and filter hooks that allow you to change the parent
theme’s functionality.
Good use of microformats
Flexible enough to make any layout through CSS alone
Why use the Genesis Framework?
World class developers.
It is beautifully coded.
It is intuitively organized.
It’s secure.
Pay once, use many.
It is reasonably priced. (59 USD)
Experts freely share their knowledge through tutorials, blog posts etc.
A quick overview of the Genesis Framework
The most important files in the Genesis framework are:
1. framework.php (genesis/lib/framework.php)
2. header.php (genesis/header.php)
3. footer.php (genesis/footer.php)
These files are complemented by the remainder of the framework which is
rather extensive consisting of 17 top-level files and 9 folders.
framework.php
Consists of a single function, genesis(). Here is what the stripped down
function looks like: 2 further function calls and 7 action hooks.
function genesis() {
get_header();
do_action( 'genesis_before_content_sidebar_wrap' );
do_action( 'genesis_before_content' );
do_action( 'genesis_before_loop' );
do_action( 'genesis_loop' );
do_action( 'genesis_after_loop' );
do_action( 'genesis_after_content' );
do_action( 'genesis_after_content_sidebar_wrap' );
get_footer();
}
Some Genesis websites: http://www.studiopress.com/theme/custom
Some Genesis websites: http://www.studiopress.com/developer/bill-erickson
Some Genesis websites: http://friendsoffreewildlife.co.za/
Developing a Genesis Child Theme
Developing a Genesis child theme follows the same basic process as
developing any other child theme.
1. Create a new directory in wp-content/themes with your child theme name
2. Create functions.php
3. Create styles.css
4. Create screenshot.png (optional) with the dimensions of 880px x 660px
Developing a Genesis Child Theme (continued)
Genesis makes use of hooks together with actions and filters to allow you to
modify the template.
A hook is a predefined place in software where you can execute custom code.
The Genesis visual hook guide is a fantastic resource when you need to see
which hook you should be using.
http://genesistutorials.com/visual-hook-guide/
Developing a Genesis Child Theme (continued)
functions.php is where all the functionality lives. Genesis has a collection of
built-in functions just like WordPress. To access these functions you need to
initiate them. There are two options to do so:
/** Start the engine */
require_once( TEMPLATEPATH . '/lib/init.php' );
Or:
add_action( 'genesis_setup','genesischild_theme_setup' );
function genesischild_theme_setup() {
// Custom child theme setup code
}
Developing a Genesis Child Theme (continued)
function genesischild_theme_setup() {
//* Add HTML5 markup structure
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-
list', 'gallery', 'caption' ) );
//* Add viewport meta tag for mobile browsers
add_theme_support( 'genesis-responsive-viewport' );
//* Add theme support for custom header
add_theme_support( 'custom-header', array(
'flex-height' => true,
'width' => 1200,
'height' => 237,
'header-selector' => '.site-title a',
'header-text' => false,
) );
}
Developing a Genesis Child Theme (continued)
You need to enqueue your theme’s stylesheets in the functions file.
function theme_enqueue_styles() {
$parent_style = 'parent-style';
wp_enqueue_style( $parent_style,
get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style )
);
}
Developing a Genesis Child Theme (continued)
How much more or little you add to your functions file is then up to you based
on the project requirements.
There are a vast number of tutorials of things that you can add to your
functions files, ranging from hamburger style menus for mobile to adding a
little heart to your footer. Google is your friend.
Developing a Genesis Child Theme (continued)
The most important thing to get right in your stylesheet is your header.
/*
Theme Name: Self-explanatory. Don’t use the words “WordPress” or “Theme”.
Theme URI: http://example.com/this-is-your-theme-url
Description: A description of the theme. I generally use something along the
lines of "A custom Genesis Child Theme for..."
Author: Your name
Author URI: Give yourself some link love!
Template: parent theme name
Tags: These are used for the WordPress theme directory’s “Feature Filter”.
Broad categories: colors, layout, features, subject.
License: self-explanatory. General consensus is that all PHP must be licensed
under GPL. CSS can have own license.
License URI: Where can people read your license terms.
*/
Helpful resources
Genesis markup guide:
Use this to customize your CSS etc and see where things are)
http://www.genesisframework.com/markup.php
Genesis visual hook guide
Use this guide to see which hooks that you want to be using to get your
code to execute in the right places. http://genesistutorials.com/visual-
hook-guide/
If you prefer the text version: http://my.studiopress.com/docs/hook-
reference/ (Paid access)
Twitter hashtag: #genesiswp
Helpful resources (continued)
The my.studiopress.com site. This is only available to people who have
bought the Genesis framework from studiopress.
Community tutorials:
Carrie Dils’s website:
http://www.carriedils.com/genesis-framework-studiopress/
Bill Erickson’s Genesis’s Quick Tips:
http://www.billerickson.net/genesis-quick-tips/
Nick The Geek’s website:
http://www.genesisframework.com/markup.php
Brian Gardner’s website:
http://briangardner.com/code/
Things to watch out for
1. Make sure that Genesis is installed as a theme before you attempt to
activate the child theme.
2. Make sure that you enqueue your stylesheets correctly using
functions.php
3. Make sure that you enable HTML5 markup in functions.php:
add_theme_support( 'html5', array( 'search-form', 'comment-form',
'comment-list', 'gallery', 'caption' ) );
4. Make sure that you have enabled the responsive viewport. If not your site
will look wonky on mobile phones and Google will not like you.
Playing with others:
Genesis fits in well with the WordPress architecture. As such, you will not
generally have conflicts with plugins. There are also some GenesisWP specific
plugins.
For people who don’t want to code:
Genesis Design Palette Pro (https://genesisdesignpro.com/) - the complete
ability to customize the appearance of a Genesis theme without needing to
write a single line of code. (Premium plugin - starts at $49 a year).
Genesis Grid: Display your posts in a grid.
(https://wordpress.org/plugins/genesis-grid-loop/)
Playing with others (continued)
For people starting to make the transition into coding their own themes
but are not yet comfortable with hooks and filters:
Genesis Simple Hooks (https://wordpress.org/plugins/genesis-simple-hooks/)
For best results use it together with
Genesis Visual Hooks:
https://wordpress.org/plugins/genesis-visual-hook-guide/
To prevent you from wanting to hunt down plugin authors with an axe:
Genesis Trump Style loads your style sheet after the plugin style sheets.
https://wordpress.org/plugins/genesis-style-trump/
Questions?
Your turn :)

Mais conteúdo relacionado

Mais procurados

Theme development essentials columbus oh word camp 2012
Theme development essentials   columbus oh word camp 2012Theme development essentials   columbus oh word camp 2012
Theme development essentials columbus oh word camp 2012
Joe Querin
 
Learning PHP for Drupal Theming, DC Chicago 2009
Learning PHP for Drupal Theming, DC Chicago 2009Learning PHP for Drupal Theming, DC Chicago 2009
Learning PHP for Drupal Theming, DC Chicago 2009
Emma Jane Hogbin Westby
 

Mais procurados (20)

Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016
 
WordPress Theme Development: Part 2
WordPress Theme Development: Part 2WordPress Theme Development: Part 2
WordPress Theme Development: Part 2
 
Theme development essentials columbus oh word camp 2012
Theme development essentials   columbus oh word camp 2012Theme development essentials   columbus oh word camp 2012
Theme development essentials columbus oh word camp 2012
 
What are child themes, and why use them
What are child themes, and why use themWhat are child themes, and why use them
What are child themes, and why use them
 
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalWordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
 
Intro To WordPress Themes
Intro To WordPress ThemesIntro To WordPress Themes
Intro To WordPress Themes
 
There's No Crying In Wordpress! (an intro to WP)
There's No Crying In Wordpress! (an intro to WP)There's No Crying In Wordpress! (an intro to WP)
There's No Crying In Wordpress! (an intro to WP)
 
Learning PHP for Drupal Theming, DC Chicago 2009
Learning PHP for Drupal Theming, DC Chicago 2009Learning PHP for Drupal Theming, DC Chicago 2009
Learning PHP for Drupal Theming, DC Chicago 2009
 
Introduction to Custom WordPress Themeing
Introduction to Custom WordPress ThemeingIntroduction to Custom WordPress Themeing
Introduction to Custom WordPress Themeing
 
WordPress Theme Development for Designers
WordPress Theme Development for DesignersWordPress Theme Development for Designers
WordPress Theme Development for Designers
 
Child Theme
Child ThemeChild Theme
Child Theme
 
Meetup child-themes
Meetup child-themesMeetup child-themes
Meetup child-themes
 
WordPress Theme Workshop: Part 4
WordPress Theme Workshop: Part 4WordPress Theme Workshop: Part 4
WordPress Theme Workshop: Part 4
 
Custom WordPress theme development
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme development
 
Parent and child themes
Parent and child themesParent and child themes
Parent and child themes
 
Evaluating Base Themes
Evaluating Base ThemesEvaluating Base Themes
Evaluating Base Themes
 
WordPress Theme Structure
WordPress Theme StructureWordPress Theme Structure
WordPress Theme Structure
 
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
 
Intro to WordPress theme development
Intro to WordPress theme developmentIntro to WordPress theme development
Intro to WordPress theme development
 
Theming in WordPress - Where do I Start?
Theming in WordPress - Where do I Start?Theming in WordPress - Where do I Start?
Theming in WordPress - Where do I Start?
 

Semelhante a WP Joburg Meetup 10: Genesis Framework by Trish Cornelius

Meetup child-themes
Meetup child-themesMeetup child-themes
Meetup child-themes
DaisyOlsen
 
Week 9 - Introduction to Child Themes
Week 9  - Introduction to Child ThemesWeek 9  - Introduction to Child Themes
Week 9 - Introduction to Child Themes
henri_makembe
 
Theme frameworks & child themes
Theme frameworks & child themesTheme frameworks & child themes
Theme frameworks & child themes
Chris Olbekson
 
2009-08-28-WordPress-Parent-Child-Themes
2009-08-28-WordPress-Parent-Child-Themes2009-08-28-WordPress-Parent-Child-Themes
2009-08-28-WordPress-Parent-Child-Themes
LightSpeed
 
Child themes
Child themesChild themes
Child themes
bobwlsn
 
Intro to WordPress Child Themes
Intro to WordPress Child ThemesIntro to WordPress Child Themes
Intro to WordPress Child Themes
vegasgeek
 

Semelhante a WP Joburg Meetup 10: Genesis Framework by Trish Cornelius (20)

Meetup child-themes
Meetup child-themesMeetup child-themes
Meetup child-themes
 
Week 9 - Introduction to Child Themes
Week 9  - Introduction to Child ThemesWeek 9  - Introduction to Child Themes
Week 9 - Introduction to Child Themes
 
Theme frameworks & child themes
Theme frameworks & child themesTheme frameworks & child themes
Theme frameworks & child themes
 
WordPress Child Themes: The what. The why. The how.
WordPress Child Themes: The what. The why. The how.WordPress Child Themes: The what. The why. The how.
WordPress Child Themes: The what. The why. The how.
 
Child Theme Frameworks
Child Theme FrameworksChild Theme Frameworks
Child Theme Frameworks
 
Introduction to WordPress Child Theming, WordCamp Kansas City, 2015
Introduction to WordPress Child Theming, WordCamp Kansas City, 2015Introduction to WordPress Child Theming, WordCamp Kansas City, 2015
Introduction to WordPress Child Theming, WordCamp Kansas City, 2015
 
2009-08-28-WordPress-Parent-Child-Themes
2009-08-28-WordPress-Parent-Child-Themes2009-08-28-WordPress-Parent-Child-Themes
2009-08-28-WordPress-Parent-Child-Themes
 
Intro to child themes
Intro to child themesIntro to child themes
Intro to child themes
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme Enlightenment
 
The Child Theme Dilemma (EN)
The Child Theme Dilemma (EN)The Child Theme Dilemma (EN)
The Child Theme Dilemma (EN)
 
Child themes
Child themesChild themes
Child themes
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017
 
Why you should be using WordPress child themes
Why you should be using WordPress child themesWhy you should be using WordPress child themes
Why you should be using WordPress child themes
 
Intro to WordPress Child Themes
Intro to WordPress Child ThemesIntro to WordPress Child Themes
Intro to WordPress Child Themes
 
The Why, When, How of WordPress Child Themes
The Why, When, How of WordPress Child ThemesThe Why, When, How of WordPress Child Themes
The Why, When, How of WordPress Child Themes
 
advance theme development
advance theme developmentadvance theme development
advance theme development
 
WordPress Theme Design and Development Workshop - Day 2
WordPress Theme Design and Development Workshop - Day 2WordPress Theme Design and Development Workshop - Day 2
WordPress Theme Design and Development Workshop - Day 2
 
The Child Theme Dilemma (EN) - Milano Edition
The Child Theme Dilemma (EN) - Milano EditionThe Child Theme Dilemma (EN) - Milano Edition
The Child Theme Dilemma (EN) - Milano Edition
 
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to DevelopmentWordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
 
Newbies guide to customizing word press themes 25
Newbies guide to customizing word press themes 25Newbies guide to customizing word press themes 25
Newbies guide to customizing word press themes 25
 

Último

No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
Sheetaleventcompany
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
Kayode Fayemi
 

Último (20)

ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
 
Mathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptxMathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptx
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AI
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)
 
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxMohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
 
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
 
George Lever - eCommerce Day Chile 2024
George Lever -  eCommerce Day Chile 2024George Lever -  eCommerce Day Chile 2024
George Lever - eCommerce Day Chile 2024
 
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
 
Air breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsAir breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animals
 
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night EnjoyCall Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
 

WP Joburg Meetup 10: Genesis Framework by Trish Cornelius

  • 1. GenesisWP from 10,000 feet Trisha Cornelius @trishawebs
  • 2. Overview What’s a theme framework Why use the Genesis Theme Framework Some #GenesisWP sites Overview of the Genesis Framework Developing a Genesis child theme Helpful Resources Things to look out for
  • 3. What’s a theme framework? “A framework is a solidly coded theme that should serve as a base for other projects.” - Justin Tadlock The codex identifies three types of frameworks: 1. A “drop-in” code library that is used to facilitate the development of a theme. (e.g. Hybrid Core) 2. A parent theme designed to be modified (e.g. Genesis) 3. Any WordPress theme that is used as the base for another theme.
  • 4. What’s a theme framework? (continued) Parent and child themes were introduced in version 2.7 of WordPress. A child theme modifies the way a parent theme looks and / or functions without changing the code in the parent theme’s files. There are two models for framework development: 1. The template model 2. The hooks model
  • 5. What’s a theme framework? (continued) The template model works by overwriting the parent theme’s files of the same name. As such template child themes may have their own: index.php single.php header.php footer.php etc
  • 6. What’s a theme framework? (continued) The hooks model uses concepts similar to plugin development and modifies the parent theme’s files without overwriting them. These types of child themes will typically only consist of functions.php style.css screenshot.png This is the model that the Genesis Framework uses.
  • 7. What’s a theme framework? (continued) The child theme’s css is loaded after the parent theme’s css giving it’s style precedence. The child theme’s functions.php file adds to the parent theme’s functions. If the child theme has a file of the same name as the parent theme, the child theme’s file has precedence. (This is where the template model comes in).
  • 8. Why use a child theme? Take advantage of parent theme updates without losing the customization. Customize a theme quickly and easily. Don’t repeat yourself. Update the parent theme in accordance with evolving best practices and push it across to all your child themes. Continuous improvement (of the developer and of best practices).
  • 9. What are the requirements of a theme framework? Good documentation Base code must be solid and in line with best practices Good use of action and filter hooks that allow you to change the parent theme’s functionality. Good use of microformats Flexible enough to make any layout through CSS alone
  • 10. Why use the Genesis Framework? World class developers. It is beautifully coded. It is intuitively organized. It’s secure. Pay once, use many. It is reasonably priced. (59 USD) Experts freely share their knowledge through tutorials, blog posts etc.
  • 11. A quick overview of the Genesis Framework The most important files in the Genesis framework are: 1. framework.php (genesis/lib/framework.php) 2. header.php (genesis/header.php) 3. footer.php (genesis/footer.php) These files are complemented by the remainder of the framework which is rather extensive consisting of 17 top-level files and 9 folders.
  • 12. framework.php Consists of a single function, genesis(). Here is what the stripped down function looks like: 2 further function calls and 7 action hooks. function genesis() { get_header(); do_action( 'genesis_before_content_sidebar_wrap' ); do_action( 'genesis_before_content' ); do_action( 'genesis_before_loop' ); do_action( 'genesis_loop' ); do_action( 'genesis_after_loop' ); do_action( 'genesis_after_content' ); do_action( 'genesis_after_content_sidebar_wrap' ); get_footer(); }
  • 13. Some Genesis websites: http://www.studiopress.com/theme/custom
  • 14. Some Genesis websites: http://www.studiopress.com/developer/bill-erickson
  • 15. Some Genesis websites: http://friendsoffreewildlife.co.za/
  • 16. Developing a Genesis Child Theme Developing a Genesis child theme follows the same basic process as developing any other child theme. 1. Create a new directory in wp-content/themes with your child theme name 2. Create functions.php 3. Create styles.css 4. Create screenshot.png (optional) with the dimensions of 880px x 660px
  • 17. Developing a Genesis Child Theme (continued) Genesis makes use of hooks together with actions and filters to allow you to modify the template. A hook is a predefined place in software where you can execute custom code. The Genesis visual hook guide is a fantastic resource when you need to see which hook you should be using. http://genesistutorials.com/visual-hook-guide/
  • 18. Developing a Genesis Child Theme (continued) functions.php is where all the functionality lives. Genesis has a collection of built-in functions just like WordPress. To access these functions you need to initiate them. There are two options to do so: /** Start the engine */ require_once( TEMPLATEPATH . '/lib/init.php' ); Or: add_action( 'genesis_setup','genesischild_theme_setup' ); function genesischild_theme_setup() { // Custom child theme setup code }
  • 19. Developing a Genesis Child Theme (continued) function genesischild_theme_setup() { //* Add HTML5 markup structure add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment- list', 'gallery', 'caption' ) ); //* Add viewport meta tag for mobile browsers add_theme_support( 'genesis-responsive-viewport' ); //* Add theme support for custom header add_theme_support( 'custom-header', array( 'flex-height' => true, 'width' => 1200, 'height' => 237, 'header-selector' => '.site-title a', 'header-text' => false, ) ); }
  • 20. Developing a Genesis Child Theme (continued) You need to enqueue your theme’s stylesheets in the functions file. function theme_enqueue_styles() { $parent_style = 'parent-style'; wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( $parent_style ) ); }
  • 21. Developing a Genesis Child Theme (continued) How much more or little you add to your functions file is then up to you based on the project requirements. There are a vast number of tutorials of things that you can add to your functions files, ranging from hamburger style menus for mobile to adding a little heart to your footer. Google is your friend.
  • 22. Developing a Genesis Child Theme (continued) The most important thing to get right in your stylesheet is your header. /* Theme Name: Self-explanatory. Don’t use the words “WordPress” or “Theme”. Theme URI: http://example.com/this-is-your-theme-url Description: A description of the theme. I generally use something along the lines of "A custom Genesis Child Theme for..." Author: Your name Author URI: Give yourself some link love! Template: parent theme name Tags: These are used for the WordPress theme directory’s “Feature Filter”. Broad categories: colors, layout, features, subject. License: self-explanatory. General consensus is that all PHP must be licensed under GPL. CSS can have own license. License URI: Where can people read your license terms. */
  • 23. Helpful resources Genesis markup guide: Use this to customize your CSS etc and see where things are) http://www.genesisframework.com/markup.php Genesis visual hook guide Use this guide to see which hooks that you want to be using to get your code to execute in the right places. http://genesistutorials.com/visual- hook-guide/ If you prefer the text version: http://my.studiopress.com/docs/hook- reference/ (Paid access) Twitter hashtag: #genesiswp
  • 24. Helpful resources (continued) The my.studiopress.com site. This is only available to people who have bought the Genesis framework from studiopress. Community tutorials: Carrie Dils’s website: http://www.carriedils.com/genesis-framework-studiopress/ Bill Erickson’s Genesis’s Quick Tips: http://www.billerickson.net/genesis-quick-tips/ Nick The Geek’s website: http://www.genesisframework.com/markup.php Brian Gardner’s website: http://briangardner.com/code/
  • 25. Things to watch out for 1. Make sure that Genesis is installed as a theme before you attempt to activate the child theme. 2. Make sure that you enqueue your stylesheets correctly using functions.php 3. Make sure that you enable HTML5 markup in functions.php: add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) ); 4. Make sure that you have enabled the responsive viewport. If not your site will look wonky on mobile phones and Google will not like you.
  • 26. Playing with others: Genesis fits in well with the WordPress architecture. As such, you will not generally have conflicts with plugins. There are also some GenesisWP specific plugins. For people who don’t want to code: Genesis Design Palette Pro (https://genesisdesignpro.com/) - the complete ability to customize the appearance of a Genesis theme without needing to write a single line of code. (Premium plugin - starts at $49 a year). Genesis Grid: Display your posts in a grid. (https://wordpress.org/plugins/genesis-grid-loop/)
  • 27. Playing with others (continued) For people starting to make the transition into coding their own themes but are not yet comfortable with hooks and filters: Genesis Simple Hooks (https://wordpress.org/plugins/genesis-simple-hooks/) For best results use it together with Genesis Visual Hooks: https://wordpress.org/plugins/genesis-visual-hook-guide/ To prevent you from wanting to hunt down plugin authors with an axe: Genesis Trump Style loads your style sheet after the plugin style sheets. https://wordpress.org/plugins/genesis-style-trump/