Skip to content

Instantly share code, notes, and snippets.

@cobaltapps
Created September 13, 2017 17:54
Show Gist options
  • Save cobaltapps/6116cfb2211924b6110a70ca8154a6b9 to your computer and use it in GitHub Desktop.
Save cobaltapps/6116cfb2211924b6110a70ca8154a6b9 to your computer and use it in GitHub Desktop.
A basic example of how to add_action a custom function into a specific hook location.
add_action( 'theme_hook_before_content', 'my_custom_text' );
/*
* Echo some text inside a function and then hook
* that function into a specified hook location
* using the add_action WordPress function.
*/
function my_custom_text() {
echo 'Hello World!';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment