Hooks allow you to add extra content or custom code at various areas inside the Customify theme. For example, you might want some advertisement below all of your blog posts. Hooks make such dynamic things easily.
How to Use Hooks
function your_function_name() { ?> Insert your custom content here <?php } add_action( 'hook_name', 'your_function_name' );
In the example above, replace hook_name with the hook where you want to add something.
Learn more: https://developer.wordpress.org/plugins/hooks/
To see the list of hooks available in Customify theme, just click the Show Hooks in the WordPress admin bar:
and then you can see all hooks position:
Customify Hooks
The Customify Hooks option allows you to inject custom code or content in the various action hooks easily. This is a premium module, available with Customify Pro. You would need to activate the module from Appearance > Customify Options > Customify Hooks.
Next, go to Appearances => Customify Hooks to add a new hook.
1 – Add your hook name. E.g: Before Header, Below Post Content, etc..
2 – Editor
- Default Editor: You can easily add the content such as simple text, paragraph, heading, etc…
- Code Editor: This option enables the code editor which is helpful to add custom code such as PHP, CSS or Javascript.
While adding your code, please make sure to include opening statements of the code which pasting your code.
P/s: You can use the Page Builder to create your hook content as well.
3 – Hooks Settings
Hook Location: Select any location you want to insert the hook. Click the View Hook Positions link to see all hooks available. Or click the Show Hooks on admin bar.
Priority: Used to specify the order in which the functions associated with a particular action are executed. Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the action.
4 – Conditionals
You can choose your custom hook to display on the entire website, archive or on specific pages/posts.
5 – User Roles
We have provided the user role option as well; so you can choose which users the code should execute for.