Documentation on Hooks in theme

Viewing 2 posts - 1 through 2 (of 2 total)
  • #21228
    bo-oz
    Participant

    Hi,

    I’ve noticed your theme uses hooks to inject html into the template files. Is there some documentation available for this? I’m looking into a way to create a small menu bar (for user navigation / login / logout / etc) above the main menu. How can I achieve this? Which hook should I use?

    #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 7 years ago by bo-oz.
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.