Use hooks

To modify your child theme using expert hooks, you will first need a good understanding of these documents BEFORE proceeding:

There are several ways you can use expert hooks:

  • Add your own custom script to Ashford
  • Remove a function you do not want
  • Move an existing function to a new position
  • Replace an existing function with your own custom script

Add your own function to Ashford

  • Using the Hooks  docs, identify the Hook which will display your new function in the right place
  • Open ashford_pro/function.php
  • Add your new function
  • Apply your new function to a Hook by adding an Action

Example: coming soon.

Remove a function you do not want

Occasionally, you will want to permanently disable a feature that do not need it for your project.

  • Using the Hooks and Actions docs, identify the action you need to remove
  • Confirm the action by opening ashford/library/ashford_actions.php
  • Open ashford_pro/function.php
  • If you cloned it from Pro, then identify a function called ashford_remove_actions() and within that action add the following code
  • Speed Dial functionality has been removed from the site
1
remove_action('ashford_region_content_bottom', 'ashford_theme_speed_dial',1);

Move an existing fuction to a new position

For example, here is how you can move the footer sidebar out of being restricted by the fixed width of the #page. First, you need to “remove” the existing action from its hook.

  • Open ashford/library/ashford_actions.php
  • Using the Hooks and Actions docs, identify the action you need to remove.
  • Open ashford_pro/function.php
  • If you cloned it from Pro, then identify a function called ashford_remove_actions() and within that action add the following code. This removes the footer from its existing position
  • You can confirm this is the correct action by reviewing the function in ashford/library/ashford_functions.php
1
remove_action('ashford_close_box', 'ashford_display_bottom',1);

Second, you need to add the existing action to a different hook.

  • Open ashford_pro/function.php
  • If you cloned it from Pro, then add this to the bottom of the file.
1
add_action('ashford_close_canvas', 'ashford_display_bottom',1);

Now your footer sidebar is moved to the bottom of the page, outside the confines of the 16 column #page. This allows you to have it expand the full width of the page.

Replace an existing function with your own custom script

First, remove the existing script.

  • Open ashford/library/ashford_actions.php
  • Using the Hooks and Actions docs, identify the action you need to remove.
  • Open ashford_pro/function.php
  • If you cloned it from Pro, then identify a function called ashford_remove_actions() and within that action add the following code
1
remove_action('ashford_region_content_bottom', 'ashford_theme_speed_dial',1);

Second add your new function to the ashford_pro/functions.php file.

Third, add a new action applying your new function to the hook.

  • Using the Hooks  docs, identify the Hook which will display your new function in the right place
  • Open ashford_pro/function.php
  • Add your new function
  • Apply your new function to a Hook by adding an Action