Build Your Own Business Website header image

Lesson 2 – Create the Custom Header

Difficulty Level -

Filed Under Topics - ,

Listed Under Lesson Subjects -

Applies to -

Set Up Thesis Design Options – Watch the Video

  • Describe the new child theme

    • 2 columns
    • thesis default header
    • mmbox
  • columns & column width
  • page framework
  • header
  • comments
  • mmbox

HTML Structures for Responsive Design – Watch the Video

  • What is an HTML Structure?

    • the div structure of a page
    • structural containers
    • with styles applied to them
  • Thesis Full Width Framework HTML Structure

    • 3 main divs
    • Each div has page
    • Each page has containers
    • #header_area .page containers
      • ul.menu
      • #header
    • #content_area .page containers
      • #content_box
        • #content
        • #sidebars
    • #footer_area .page containers
      • #footer
  • What Happens when a site responds to device width?

    • shrink
    • stack
    • disappear

Set Up the Child Theme File Structure – Watch the Video

  • Copy lesson 1 files

    • grab the new screenshot
  • An organizational scheme

    • custom
    • lib
  • Contents of lib

    • admin
    • classes
    • css
    • functions
    • images
    • scripts
    • widgets
  • Add Thesis to the NetBeans project

WordPress Constants and File Locations – Watch the Video

  • Why use constants?

    • Makes your code modular
    • Allows you to change file locations without changing lots of code
  • 3 ways of referencing constants

    • WordPress defined constants
    • get_bloginfo()
    • get_directory
    • local vs http
  • Parent theme constants – TEMPLATEPATH

    • get_template_directory()
    • get_template_directory_uri()
  • Child theme constants – STYLESHEETPATH

    • get_stylesheet_directory()
    • get_stylesheet_directory_uri()
  • Create custom constants Define

    • syntax
    • WordPress standards
    • CRTC_PATH
    • CRTC_LIB
    • CRTC_FUNCTIONS
    • CRTC_CLASSES
  • Include theme files Include_once

    • syntax

Understanding the Thesis Header & Nav Menu – Watch the Video

  • The Thesis default header

    • Follow the Thesis path
      • Start with frameworks
      • builds the head
      • chooses the framework
    • function – thesis_header()
    • function – thesis_default_header()
      • image or
      • title & tagline
    • file – launch.php
  • The Thesis Nav Menu

    • Calls register_nav_menu()
    • WordPress register_nav_menu()
      • registers a location
      • location can be selected from the appearance >> menus admin screen
      • doesn’t place the menu anywhere – simply gives it a handle
    • thesis_nav_menu()
      • initially hooked in launch.php
      • checks to see if a WP menu is created
        • IF so, calls wp_nav_menu()
      • checks to see if Thesis menu is created

Construct the Child Theme Header – Watch the Video

  • Create and include the file

  • Create the function

    • function name
  • Create the HTML Structures
    • div left
    • div right
    • clearing div
  • Add Thesis Functionality to the header

  • Add the Menu to the Header

    • understanding wp_nav_menu()
      • typical arguments
      • default values
    • our use of the wp_nav_menu()
      • primary location
      • container
      • fallback

Repurposing the Thesis Custom Loop – Watch the Video

  • Overview of what the class does

    • calls the parent construct method
      • parent construct method determines which loop should be applied
    • specifies the method that fires on the wp init hook
    • init method specifies actions and filters methods to fire
    • sample home loop
    • sample archive loop
  • Change it

    • rename it
    • remove the sample loops
    • add the header function to the action method
    • check the result
  • Place it in it’s own file
  • Include the file
  • check the result

Question and Answer Session – Watch the Video

Save $200 on Membership Now!

Start learning today for as little as
$0.82 PER DAY!
THIS IS A LIMITED TIME OFFER!
Subscription Options
2 Comments… add one
2 comments… add one
  • Aernout Zevenbergen July 2, 2012, 2:51 am

    Hi Rick,

    I recently signed up to your site, after finding it via the forum of Thesis.
    I am keen to learn how to use Responsive Theme building, and am now a Free Member – due to financial constraints.
    Once I have generated a bit of cash again, I’ll sign up for the “pay in two brackets” membership for a year, which for now is simply not possible. Unfortunately.
    Having said that, I hope you won’t mind me asking the following.

    In Part 6 of this lesson, you take us through writing the crtc_header.php.
    That one keeps giving me a parse error, on the line 7.
    What am I doing wrong?

    <?php

    function crtc_add_header_html() {

    echo "\t “;
    thesis_default_header()
    echo “\t “; (this is the line that creates trouble)

    echo “\t “;
    thesis_nav_menu()
    echo “\t “;
    }

  • Rick Anderson July 2, 2012, 6:31 am

    Aernout, you are missing the semi-colons after each statement.

Leave a Comment