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 nokke_sidebar_before hook. The code example would be:
1 2 3 4 |
add_action( 'nokke_sidebar_before', 'nokke_add_sidebar_message' ); function nokke_add_sidebar_message() { echo esc_html__( 'Sidebar Message', 'nokke' ); } |
List of available Hooks:
- nokke_head_top
- nokke_head_bottom
- nokke_header_before
- nokke_header
- nokke_header_after
- nokke_masthead
- nokke_menu_before
- nokke_menu_after
- nokke_last_menu_item_after
- nokke_body_top
- nokke_body_bottom
- nokke_primary_content_top
- nokke_primary_content_before
- nokke_primary_content_query
- nokke_primary_content_after
- nokke_primary_content_bottom
- nokke_comments_before
- nokke_comments
- nokke_comments_after
- nokke_entry_section_before
- nokke_entry_header_before
- nokke_entry_header
- nokke_entry_header_after
- nokke_content_before
- nokke_content_top
- nokke_content_bottom
- nokke_content_after
- nokke_entry_featured_image
- nokke_entry_content_top
- nokke_entry_content_bottom
- nokke_page_title_before
- nokke_page_title_after
- nokke_sidebar_before
- nokke_sidebar_after
- nokke_footer_before
- nokke_footer
- nokke_footer_after