SlideShare a Scribd company logo
1 of 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 :)

More Related Content

What's hot

Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016David Brattoli
 
WordPress Theme Development: Part 2
WordPress Theme Development: Part 2WordPress Theme Development: Part 2
WordPress Theme Development: Part 2Josh Lee
 
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 2012Joe Querin
 
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 themUtsav Singh Rathour
 
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 NepalChandra Prakash Thapa
 
Intro To WordPress Themes
Intro To WordPress ThemesIntro To WordPress Themes
Intro To WordPress Themesdamonsharp
 
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)Grace Solivan
 
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 2009Emma Jane Hogbin Westby
 
Introduction to Custom WordPress Themeing
Introduction to Custom WordPress ThemeingIntroduction to Custom WordPress Themeing
Introduction to Custom WordPress ThemeingJamie Schmid
 
WordPress Theme Development for Designers
WordPress Theme Development for DesignersWordPress Theme Development for Designers
WordPress Theme Development for Designerselliotjaystocks
 
Meetup child-themes
Meetup child-themesMeetup child-themes
Meetup child-themesDaisyOlsen
 
WordPress Theme Workshop: Part 4
WordPress Theme Workshop: Part 4WordPress Theme Workshop: Part 4
WordPress Theme Workshop: Part 4David Bisset
 
Custom WordPress theme development
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme developmentTammy Hart
 
Parent and child themes
Parent and child themesParent and child themes
Parent and child themesTom Jenkins
 
WordPress Theme Structure
WordPress Theme StructureWordPress Theme Structure
WordPress Theme Structurekeithdevon
 
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 ...LinnAlexandra
 
Intro to WordPress theme development
Intro to WordPress theme developmentIntro to WordPress theme development
Intro to WordPress theme developmentThad Allender
 
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?Edmund Turbin
 

What's hot (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?
 

Similar to WP Joburg Meetup 10: Genesis Framework by Trish Cornelius

Meetup child-themes
Meetup child-themesMeetup child-themes
Meetup child-themesDaisyOlsen
 
Week 9 - Introduction to Child Themes
Week 9  - Introduction to Child ThemesWeek 9  - Introduction to Child Themes
Week 9 - Introduction to Child Themeshenri_makembe
 
Theme frameworks & child themes
Theme frameworks & child themesTheme frameworks & child themes
Theme frameworks & child themesChris Olbekson
 
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.Janelle Reichman
 
Child Theme Frameworks
Child Theme FrameworksChild Theme Frameworks
Child Theme Frameworksryngrn
 
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, 2015topher1kenobe
 
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-ThemesLightSpeed
 
Intro to child themes
Intro to child themesIntro to child themes
Intro to child themesvegasgeek
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme EnlightenmentAmanda Giles
 
Child themes
Child themesChild themes
Child themesbobwlsn
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017Amanda Giles
 
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 themesAnthony Hortin
 
Intro to WordPress Child Themes
Intro to WordPress Child ThemesIntro to WordPress Child Themes
Intro to WordPress Child Themesvegasgeek
 
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 ThemesAnthony Hortin
 
advance theme development
advance theme developmentadvance theme development
advance theme development1amitgupta
 
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 2Mizanur Rahaman Mizan
 
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 EditionTorsten Landsiedel
 
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 DevelopmentEvan Mullins
 
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 25New Tricks
 

Similar to 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
 

Recently uploaded

RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATIONRACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATIONRachelAnnTenibroAmaz
 
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Krijn Poppe
 
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power
 
Event 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxEvent 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxaryanv1753
 
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...Henrik Hanke
 
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...marjmae69
 
Quality by design.. ppt for RA (1ST SEM
Quality by design.. ppt for  RA (1ST SEMQuality by design.. ppt for  RA (1ST SEM
Quality by design.. ppt for RA (1ST SEMCharmi13
 
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.KathleenAnnCordero2
 
SBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation TrackSBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation TrackSebastiano Panichella
 
Chizaram's Women Tech Makers Deck. .pptx
Chizaram's Women Tech Makers Deck.  .pptxChizaram's Women Tech Makers Deck.  .pptx
Chizaram's Women Tech Makers Deck. .pptxogubuikealex
 
Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸mathanramanathan2005
 
PHYSICS PROJECT BY MSC - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC  - NANOTECHNOLOGYPHYSICS PROJECT BY MSC  - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC - NANOTECHNOLOGYpruthirajnayak525
 
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...漢銘 謝
 
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRRINDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRRsarwankumar4524
 
The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationNathan Young
 
Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Escort Service
 
The 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringThe 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringSebastiano Panichella
 
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSimulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSebastiano Panichella
 
miladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptxmiladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptxCarrieButtitta
 
Anne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptxAnne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptxnoorehahmad
 

Recently uploaded (20)

RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATIONRACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
 
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
 
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
 
Event 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxEvent 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptx
 
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
 
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
 
Quality by design.. ppt for RA (1ST SEM
Quality by design.. ppt for  RA (1ST SEMQuality by design.. ppt for  RA (1ST SEM
Quality by design.. ppt for RA (1ST SEM
 
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
 
SBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation TrackSBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation Track
 
Chizaram's Women Tech Makers Deck. .pptx
Chizaram's Women Tech Makers Deck.  .pptxChizaram's Women Tech Makers Deck.  .pptx
Chizaram's Women Tech Makers Deck. .pptx
 
Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸
 
PHYSICS PROJECT BY MSC - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC  - NANOTECHNOLOGYPHYSICS PROJECT BY MSC  - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC - NANOTECHNOLOGY
 
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
 
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRRINDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRR
 
The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism Presentation
 
Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170
 
The 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringThe 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software Engineering
 
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSimulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
 
miladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptxmiladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptx
 
Anne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptxAnne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptx
 

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/