Using Hooks

GeneratePress uses theWordPress Hooks APIto insert various hooks throughout the theme.

These hooks allow you to insert functions into various areas inside the theme.

To view the available hooks, please refer to theHooks category.

Usage

add_action( 'your_hook_name','example_function_name' );
function example_function_name() {?>
Insert your hook contents in here.
<?php }

In the example above, replaceyour_hook_namewith the name of the hook you’re wanting to use, likewp_headorgenerate_before_header.

Then replaceexample_function_namewith a unique function name, something specific to you. My name is Tom Usborne, so I would prefix my function like this for example:tu_insert_into_wp_head

Learn how to add PHPhere.