{"id":1975,"date":"2019-04-11T03:39:17","date_gmt":"2019-04-11T03:39:17","guid":{"rendered":"https:\/\/docs.deothemes.com\/xhibiter\/?post_type=manual_kb&#038;p=1975"},"modified":"2023-07-07T06:49:09","modified_gmt":"2023-07-07T06:49:09","slug":"theme-hooks","status":"publish","type":"manual_kb","link":"https:\/\/docs.deothemes.com\/xhibiter\/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>xhibiter_sidebar_before <\/strong>hook. The code example would be:<\/p>\n<pre class=\"lang:php decode:true \">add_action( 'xhibiter_sidebar_before', 'xhibiter_add_sidebar_message' );\r\nfunction xhibiter_add_sidebar_message() {\r\n  echo esc_html__( 'Sidebar Message', 'xhibiter' );\r\n}<\/pre>\n<h3>List of available Hooks:<\/h3>\n<ul>\n<li>xhibiter_head_top<\/li>\n<li>xhibiter_head_bottom<\/li>\n<li>xhibiter_header_before<\/li>\n<li>xhibiter_header<\/li>\n<li>xhibiter_header_after<\/li>\n<li>xhibiter_masthead<\/li>\n<li>xhibiter_logo_before<\/li>\n<li>xhibiter_logo_after<\/li>\n<li>xhibiter_menu_before<\/li>\n<li>xhibiter_menu_after<\/li>\n<li>xhibiter_last_menu_item_after<\/li>\n<li>xhibiter_body_top<\/li>\n<li>xhibiter_body_bottom<\/li>\n<li>xhibiter_primary_content_top<\/li>\n<li>xhibiter_primary_content_before<\/li>\n<li>xhibiter_primary_content_query<\/li>\n<li>xhibiter_primary_content_after<\/li>\n<li>xhibiter_primary_content_bottom<\/li>\n<li>xhibiter_comments_before<\/li>\n<li>xhibiter_comments<\/li>\n<li>xhibiter_comments_after<\/li>\n<li>xhibiter_entry_section_before<\/li>\n<li>xhibiter_content_before<\/li>\n<li>xhibiter_content_top<\/li>\n<li>xhibiter_content_bottom<\/li>\n<li>xhibiter_content_after<\/li>\n<li>xhibiter_entry_featured_image_before<\/li>\n<li>xhibiter_entry_featured_image<\/li>\n<li>xhibiter_entry_featured_image_after<\/li>\n<li>xhibiter_entry_content_top<\/li>\n<li>xhibiter_entry_content_bottom<\/li>\n<li>xhibiter_page_title_before<\/li>\n<li>xhibiter_page_title_after<\/li>\n<li>xhibiter_sidebar_before<\/li>\n<li>xhibiter_sidebar_after<\/li>\n<li>xhibiter_footer_before<\/li>\n<li>xhibiter_footer<\/li>\n<li>xhibiter_footer_after<\/li>\n<\/ul>\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\/xhibiter\/wp-json\/wp\/v2\/manual_kb\/1975","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.deothemes.com\/xhibiter\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/docs.deothemes.com\/xhibiter\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/docs.deothemes.com\/xhibiter\/wp-json\/wp\/v2\/users\/2"}],"version-history":[{"count":15,"href":"https:\/\/docs.deothemes.com\/xhibiter\/wp-json\/wp\/v2\/manual_kb\/1975\/revisions"}],"predecessor-version":[{"id":2422,"href":"https:\/\/docs.deothemes.com\/xhibiter\/wp-json\/wp\/v2\/manual_kb\/1975\/revisions\/2422"}],"wp:attachment":[{"href":"https:\/\/docs.deothemes.com\/xhibiter\/wp-json\/wp\/v2\/media?parent=1975"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/docs.deothemes.com\/xhibiter\/wp-json\/wp\/v2\/manualknowledgebasecat?post=1975"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/docs.deothemes.com\/xhibiter\/wp-json\/wp\/v2\/manual_kb_tag?post=1975"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}