Theme hooks allows 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 arendelle_sidebar_before hook. The code example would be:
1 2 3 4 |
add_action( 'arendelle_sidebar_before', 'arendelle_add_sidebar_message' ); function arendelle_add_sidebar_message() { echo esc_html__( 'Sidebar Message', 'arendelle' ); } |
List of available Hooks:
- arendelle_head_top
- arendelle_head_bottom
- arendelle_header_before
- arendelle_header
- arendelle_header_after
- arendelle_masthead
- arendelle_menu_before
- arendelle_menu_after
- arendelle_last_menu_item_after
- arendelle_body_top
- arendelle_body_bottom
- arendelle_primary_content_top
- arendelle_primary_content_before
- arendelle_primary_content_query
- arendelle_primary_content_after
- arendelle_primary_content_bottom
- arendelle_comments_before
- arendelle_comments
- arendelle_comments_after
- arendelle_entry_section_before
- arendelle_entry_header_before
- arendelle_entry_header
- arendelle_entry_header_after
- arendelle_content_before
- arendelle_content_top
- arendelle_content_bottom
- arendelle_content_after
- arendelle_entry_featured_image
- arendelle_entry_content_top
- arendelle_entry_content_bottom
- arendelle_page_title_before
- arendelle_page_title_after
- arendelle_sidebar_before
- arendelle_sidebar_after
- arendelle_footer_before
- arendelle_footer
- arendelle_footer_after