Theme hooks allow you to hook into a theme functionality without modifying the core files. Read more about Actions and Filters API here – https://codex.wordpress.org/Plugin_API
How to use Hooks.
In your child theme edit functions.php and add your scripts. Let’s say you want to add something before sidebar, we’ll use blockst_sidebar_before hook. The code example would be:
1 2 3 4 |
add_action( '<strong>blockst</strong>_sidebar_before', '<strong>blockst</strong>_add_sidebar_message' ); function <strong>blockst</strong>_add_sidebar_message() { echo esc_html__( 'Sidebar Message', '<strong>blockst</strong>' ); } |
List of available Hooks:
-
- blockst_head_top
- blockst_head_bottom
- blockst_header_before
- blockst_header
- blockst_header_after
- blockst_masthead
- blockst_menu_before
- blockst_menu_after
- blockst_last_menu_item_after
- blockst_body_top
- blockst_body_bottom
- blockst_primary_content_top
- blockst_primary_content_before
- blockst_primary_content_query
- blockst_primary_content_after
- blockst_primary_content_bottom
- blockst_comments_before
- blockst_comments
- blockst_comments_after
- blockst_entry_section_before
- blockst_entry_header_before
- blockst_entry_header
- blockst_entry_header_after
- blockst_content_before
- blockst_content_top
- blockst_content_bottom
- blockst_content_after
- blockst_entry_featured_image
- blockst_entry_content_top
- blockst_entry_content_bottom
- blockst_page_title_before
- blockst_page_title_after
- blockst_sidebar_before
- blockst_sidebar_after
- blockst_footer_before
- blockst_footer
- blockst_footer_after