Build Your Own Business Website header image

Lesson 9 – Introduction to Customizing Thesis Using PHP

Difficulty Level -

Filed Under Topics - ,

Listed Under Lesson Subjects - ,

Applies to -

This Thesis theme video tutorial lesson provides an introduction to customizing the Thesis theme using PHP, no prior knowledge of PHP is assumed. We begin by reviewing the traditional way of learning PHP and introduce a new method of leaning PHP that is focused on the Thesis theme. We also introduce resources that you can use to support your learning. Then we delve into the structure of the Thesis custom_functions.php file to give you an understanding of how to use the file.

The remainder of the lesson is focused on using hooks. After an introduction to Action Hooks and hooks in general, we provide three working examples of how to use them. You continue to learn more about PHP, action hooks and using the custom_functions.php file as you work through each example.

How to Learn PHP – Watch the Video

  • Traditional method
    • Set up a local server
    • Hello World
    • Start learning the fundamental building blocks
    • Can’t do anything significant
    • 2 sets of tools
  • Thesis Theme method
    • Work on a live server
    • Start with a very sophisticated set of tools
    • Can do significant things
    • 3 sets of tools
  • Resources
    • Thesis User Guide
    • WordPress Codex
    • W3Schools
  • Work locally
    • A local file structure that mirrors the website files structure
    • Why not use the custom file editor?
  • Tools of the Trade
    • FileZilla
    • NetBeans
    • Firefox/Firebug/Web Developer
    • Why these tools?

Anatomy of the Thesis theme custom_functions.php file – Watch the Video

  • Opening tag
    • Rules for use
    • No closing tag
  • Comment block
    • Single line of comments
    • Comment block
  • Where to add your code

Introduction to Action Hooks – Watch the Video

  • What is an action hook?
    • A WordPress function
    • A hook is a place where you can attach your own functions
    • This is an example of an advanced concept available to the Thesis method of learning PHP
  • Where are the hooks?
    • Hook reference guide
    • Visual reference guide

Example #1 – The “Hello World” of action hooks – Watch the Video

  • Terminology
    • Statement
    • Function
  • Anatomy of a WordPress action hook
    • activated by using an “action statement”
    • function name – add_action(), remove_action()
    • parameters
    • closing semi-colon
  • Remove the Thesis Nav Menu from its default location
    • the action statement – remove_action()
    • the hook – thesis_hook_before_header
    • the function name
    • add the function to custom_functions.php
    • upload
    • test
  • Add the Thesis Nav Menu to a new location (below the header)
    • the action statement – add_action()
    • the hook – thesis_hook_after_header
    • the function name
    • add to custom_functions.php
    • upload
    • test

Example #2 – Change the Thesis footer – Watch the Video

  • Understanding the default Thesis theme footer
    • It’s HTML structure
    • It’s PHP structure
  • Remove the default footer attribution
    • the hook
  • the function name
  • the remove_action()
  • Add our own custom footer attribution
  • Anatomy of a custom function
  • Code conventions
  • Including HTML in a PHP function
  • Add our copyright attribution

Example #3 – Refine our custom footer attribution with automatic copyright date and site title – Watch the Video

Question and Answer Session – Watch the Video

Save $200 on Membership Now!

Start learning today for as little as
$0.82 PER DAY!
Subscription Options
0 Comments… add one
0 comments… add one