Hooked on Genesis

Sal Ferrarello / @salcode

(Skip to Resources)

Genesis was the key

to my understanding WordPress

Genesis is all about WordPress Hooks

add to functions.php


function fe_hi() {
  echo '<p style="color:red; font-size:20px;">';
    echo 'Hello';
  echo '</p>';
}

Add Hook


add_action( hook, function );

genesis_site_title hook


add_action( 'genesis_site_title', 'fe_hi' );

genesis_header_right hook


add_action( 'genesis_header_right', 'fe_hi' );
					

genesis_entry_header hook


add_action( 'genesis_entry_header', 'fe_hi' );
					

These Hooks are Consistent Across all Genesis Themes

Instead of "Display This"

Think "Change This"

Page Template


<?php
/* Template Name: Demo Template */

genesis();

Page Template


<?php
/* Template Name: Demo Template  */

add_action( 'genesis_header', 'fe_hi');

genesis();
					

How Do You Know the Hook Names?

There's a plugin for that

Genesis Visual Hook Guide

Elevator Pitch

Solid defaults, easy to customize programmatically

Customize Programmatically

Nuances of Genesis

  • Modify Child Theme Directly, no grandchild theme
  • Do Not use Built in SEO
  • Do Not use the Blog Template
  • Genesis `functions.php` needs to execute first

Resources

Iron Code Studio

Sal Ferrarello

@salcode

ironco.de/presentations/hooked-on-genesis/