Build Your Own Business Website header image

Lesson 5 – Creating Custom Page Templates in Genesis

Difficulty Level -

Filed Under Topics - , ,

Listed Under Lesson Subjects -

Applies to -

This is the fifth lesson in our Customize Genesis Like a Pro video tutorial course but it’s also the third lesson on how to customize the Genesis Theme using PHP. Here you’ll learn how to create your own custom page templates in Genesis. We begin by laying out the fundamental elements of custom templates to give you a solid understanding of how they are put together and named. Then we show you several ways to customize templates with custom headers, sidebars, widgets and more. To finish, you’ll learn how to create your own custom landing page template.

Fundamental Elements of Genesis Custom Templates

  • Template naming convention
    • user selectable pages
  • Header
    • Template Name
  • Changes
  • Genesis
  • Location

Create a Custom Template with a Custom Header in Genesis

  • Create the file
  • Remove the default header
    • hook – genesis_header
    • function name – genesis_do_header
  • Add our own header
    • Genesis html
    • Our image html

Replace Hard Coded URLs with WordPress Constants

  • Home URL
  • Stylesheet directory URI
  • Escaping URLs when outputting them on a page
  • Watch for the trailing slash

Add a Custom Body Class to a Template

  • How filters work
    • modify existing content
    • passes values to the function for modifications
    • values must be returned
  • create a function
  • filter_hook – body_class

Create a Custom Template with a Widgetized Header in Genesis

  • Create the file
  • Remove the default header
    • hook
    • function name
  • Register the sidebar
  • Add our own sidebar to the header
    • Genesis html
    • insert the sidebar
  • Add a custom body class

Create a Custom Template with a Custom Sidebar in Genesis

  • Create the file
  • Remove the default header
    • hook
    • function name
  • Register the sidebar
  • Add our own sidebar to the sidebar
    • Genesis html
    • insert the sidebar

Force a Layout on a Custom Template in Genesis

  • filter hook – genesis_site_layout
  • function name – __genesis_return_content_sidebar
  • Add our custom body class

Question and Answer

Save $200 on Membership Now!

Start learning today for as little as
$0.82 PER DAY!
THIS IS A LIMITED TIME OFFER!
Subscription Options
0 Comments… add one
0 comments… add one

Leave a Comment