{"id":1975,"date":"2019-04-11T03:39:17","date_gmt":"2019-04-11T03:39:17","guid":{"rendered":"https:\/\/docs.deothemes.com\/amela\/?post_type=manual_kb&#038;p=1975"},"modified":"2021-08-07T12:06:36","modified_gmt":"2021-08-07T12:06:36","slug":"theme-hooks","status":"publish","type":"manual_kb","link":"https:\/\/docs.deothemes.com\/amela\/knowledgebase\/theme-hooks\/","title":{"rendered":"Theme Hooks"},"content":{"rendered":"<p>Theme hooks allow you to hook into a theme functionality without modifying the core files. Read more about Actions and Filters API here &#8211; <a href=\"https:\/\/codex.wordpress.org\/Plugin_API\">https:\/\/codex.wordpress.org\/Plugin_API<\/a><\/p>\n<h3>How to use Hooks.<\/h3>\n<p>In your child theme edit <strong>functions.php<\/strong> and add your scripts. Let&#8217;s say you want to add something before sidebar, we&#8217;ll use <strong>amela_sidebar_before <\/strong>hook. The code example would be:<\/p>\n<pre class=\"lang:php decode:true \">add_action( 'amela_sidebar_before', 'amela_add_sidebar_message' );\r\nfunction amela_add_sidebar_message() {\r\n  echo esc_html__( 'Sidebar Message', 'amela' );\r\n}<\/pre>\n<h3>List of available Hooks:<\/h3>\n<div>\n<ul>\n<li>amela_head_top<\/li>\n<li>amela_head_bottom<\/li>\n<li>amela_header_before<\/li>\n<li>amela_header<\/li>\n<li>amela_header_after<\/li>\n<li>amela_masthead<\/li>\n<li>amela_menu_before<\/li>\n<li>amela_menu_after<\/li>\n<li>amela_last_menu_item_after<\/li>\n<li>amela_body_top<\/li>\n<li>amela_body_bottom<\/li>\n<li>amela_primary_content_top<\/li>\n<li>amela_primary_content_before<\/li>\n<li>amela_primary_content_query<\/li>\n<li>amela_primary_content_after<\/li>\n<li>amela_primary_content_bottom<\/li>\n<li>amela_comments_before<\/li>\n<li>amela_comments<\/li>\n<li>amela_comments_after<\/li>\n<li>amela_entry_section_before<\/li>\n<li>amela_entry_header_before<\/li>\n<li>amela_entry_header<\/li>\n<li>amela_entry_header_after<\/li>\n<li>amela_content_before<\/li>\n<li>amela_content_top<\/li>\n<li>amela_content_bottom<\/li>\n<li>amela_content_after<\/li>\n<li>amela_entry_featured_image<\/li>\n<li>amela_entry_content_top<\/li>\n<li>amela_entry_content_bottom<\/li>\n<li>amela_page_title_before<\/li>\n<li>amela_page_title_after<\/li>\n<li>amela_sidebar_before<\/li>\n<li>amela_sidebar_after<\/li>\n<li>amela_footer_before<\/li>\n<li>amela_footer<\/li>\n<li>amela_footer_after<\/li>\n<\/ul>\n<\/div>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"template":"","format":"standard","manualknowledgebasecat":[48],"manual_kb_tag":[],"class_list":["post-1975","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-others"],"_links":{"self":[{"href":"https:\/\/docs.deothemes.com\/amela\/wp-json\/wp\/v2\/manual_kb\/1975","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.deothemes.com\/amela\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/docs.deothemes.com\/amela\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/docs.deothemes.com\/amela\/wp-json\/wp\/v2\/users\/2"}],"version-history":[{"count":14,"href":"https:\/\/docs.deothemes.com\/amela\/wp-json\/wp\/v2\/manual_kb\/1975\/revisions"}],"predecessor-version":[{"id":2323,"href":"https:\/\/docs.deothemes.com\/amela\/wp-json\/wp\/v2\/manual_kb\/1975\/revisions\/2323"}],"wp:attachment":[{"href":"https:\/\/docs.deothemes.com\/amela\/wp-json\/wp\/v2\/media?parent=1975"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/docs.deothemes.com\/amela\/wp-json\/wp\/v2\/manualknowledgebasecat?post=1975"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/docs.deothemes.com\/amela\/wp-json\/wp\/v2\/manual_kb_tag?post=1975"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}