Reply To: Documentation on Hooks in theme

#21232
bo-oz
Participant

Ok, I figured it out myself. Just for anyone else looking to inject their own contents or snippets into the existing template, use the following code in your child theme’s functions.php:


// example of how to customize the part before the header nav & logo is injected in the page
add_filter('enlightenment_before_header','enlightenment_before_header_custom');
function enlightenment_before_header_custom() {
  // do stuff here, like echoing HTML content or use build-in wordpress functions
  echo '<p>this paragraph appears above the header (in the HTML source)</p>';
}

You can replace the ‘enlightenment_before_header’ with each hook that’s available in the template.

  • This reply was modified 9 years, 7 months ago by bo-oz.