Functions

You should start with Yoast’s definitive Anatomy of a WordPress Theme.

Ashford parent theme

This page attempts to explain how an Ashford child theme page is built by following the 2 functions.php files used when building a child theme like Pro. To figure out how Ashford wants to be different from the default experience, WordPress first looks to the parent theme’s functions.php file :

  • It defines global variables.
  • It registers language, menu post format, background, header and thumbnail support.
  • Then it loads all Ashford PHP library files.

These PHP library files hold the code to create Ashford (and all child themes even Pro):

  • ashford_mdedect.php
    Loads the mobile detection by MobileEsp.
  • ashford_sidebars.php
    Registers all Ashford sidebars.
  • ashford_functions.php
    Collects all the PHP scripts used by Ashford.
  • ashford_actions.php
    Creates hooks and applies actions.
  • ashford_paginate.php
    Loads pagination script by Eric Martin.
  • ashford_sandbox.php
    Loads the class script used by the Sandbox theme. Soon to be deprecated by WP new class scripts.
  • ashford_widgets.php
    Loads the custom widget scripts.

Pro child theme

The Ashford Pro child theme’s functions.php file does several more things. The first of which is that it enables more functionality than the free version. It first does this by creating 2 new remove actions. So a few of the actions applied to hooks by the free version of Ashford are removed by Pro. Why? So Pro can substitute/replace the free version with a Pro version of the feature. For example, Pro removes the free Hero script replacing it with the Pro Hero version.