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 amela_sidebar_before hook. The code example would be:
1 2 3 4 |
add_action( 'amela_sidebar_before', 'amela_add_sidebar_message' ); function amela_add_sidebar_message() { echo esc_html__( 'Sidebar Message', 'amela' ); } |
List of available Hooks:
- amela_head_top
- amela_head_bottom
- amela_header_before
- amela_header
- amela_header_after
- amela_masthead
- amela_menu_before
- amela_menu_after
- amela_last_menu_item_after
- amela_body_top
- amela_body_bottom
- amela_primary_content_top
- amela_primary_content_before
- amela_primary_content_query
- amela_primary_content_after
- amela_primary_content_bottom
- amela_comments_before
- amela_comments
- amela_comments_after
- amela_entry_section_before
- amela_entry_header_before
- amela_entry_header
- amela_entry_header_after
- amela_content_before
- amela_content_top
- amela_content_bottom
- amela_content_after
- amela_entry_featured_image
- amela_entry_content_top
- amela_entry_content_bottom
- amela_page_title_before
- amela_page_title_after
- amela_sidebar_before
- amela_sidebar_after
- amela_footer_before
- amela_footer
- amela_footer_after