Header
Hooks in WordPress allow us to modify or extend WordPress/Theme functionality without altering core files of the theme.
Action hooks
Instead of overriding the header.php file, which is located in the root directory of the parent theme if not needed we can use the predefined hooks from nx-theme
nx_head_open
nx_head_close
nx_body_open
nx_before_main
How to use
In order to use the predefined action hooks we need to use add_action
function with our own, to call as viewed below. Keep in mind that we can name our function as we please so replace custom_header_message
with whatever you like.
function custom_header_message() { echo 'Custom message in header.
'; } add_action('nx_head_open', 'custom_header_message');