{"id":1975,"date":"2019-04-11T03:39:17","date_gmt":"2019-04-11T03:39:17","guid":{"rendered":"https:\/\/docs.deothemes.com\/blockst\/?post_type=manual_kb&#038;p=1975"},"modified":"2022-06-12T08:47:04","modified_gmt":"2022-06-12T08:47:04","slug":"theme-hooks","status":"publish","type":"manual_kb","link":"https:\/\/docs.deothemes.com\/blockst\/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>blockst_sidebar_before <\/strong>hook. The code example would be:<\/p>\n<pre class=\"lang:php decode:true\">add_action( '<strong>blockst<\/strong>_sidebar_before', '<strong>blockst<\/strong>_add_sidebar_message' );\r\nfunction <strong>blockst<\/strong>_add_sidebar_message() {\r\n  echo esc_html__( 'Sidebar Message', '<strong>blockst<\/strong>' );\r\n}<\/pre>\n<h3>List of available Hooks:<\/h3>\n<div>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>blockst_head_top<\/li>\n<li>blockst_head_bottom<\/li>\n<li>blockst_header_before<\/li>\n<li>blockst_header<\/li>\n<li>blockst_header_after<\/li>\n<li>blockst_masthead<\/li>\n<li>blockst_menu_before<\/li>\n<li>blockst_menu_after<\/li>\n<li>blockst_last_menu_item_after<\/li>\n<li>blockst_body_top<\/li>\n<li>blockst_body_bottom<\/li>\n<li>blockst_primary_content_top<\/li>\n<li>blockst_primary_content_before<\/li>\n<li>blockst_primary_content_query<\/li>\n<li>blockst_primary_content_after<\/li>\n<li>blockst_primary_content_bottom<\/li>\n<li>blockst_comments_before<\/li>\n<li>blockst_comments<\/li>\n<li>blockst_comments_after<\/li>\n<li>blockst_entry_section_before<\/li>\n<li>blockst_entry_header_before<\/li>\n<li>blockst_entry_header<\/li>\n<li>blockst_entry_header_after<\/li>\n<li>blockst_content_before<\/li>\n<li>blockst_content_top<\/li>\n<li>blockst_content_bottom<\/li>\n<li>blockst_content_after<\/li>\n<li>blockst_entry_featured_image<\/li>\n<li>blockst_entry_content_top<\/li>\n<li>blockst_entry_content_bottom<\/li>\n<li>blockst_page_title_before<\/li>\n<li>blockst_page_title_after<\/li>\n<li>blockst_sidebar_before<\/li>\n<li>blockst_sidebar_after<\/li>\n<li>blockst_footer_before<\/li>\n<li>blockst_footer<\/li>\n<li>blockst_footer_after<\/li>\n<\/ul>\n<\/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\/blockst\/wp-json\/wp\/v2\/manual_kb\/1975","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.deothemes.com\/blockst\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/docs.deothemes.com\/blockst\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/docs.deothemes.com\/blockst\/wp-json\/wp\/v2\/users\/2"}],"version-history":[{"count":14,"href":"https:\/\/docs.deothemes.com\/blockst\/wp-json\/wp\/v2\/manual_kb\/1975\/revisions"}],"predecessor-version":[{"id":2365,"href":"https:\/\/docs.deothemes.com\/blockst\/wp-json\/wp\/v2\/manual_kb\/1975\/revisions\/2365"}],"wp:attachment":[{"href":"https:\/\/docs.deothemes.com\/blockst\/wp-json\/wp\/v2\/media?parent=1975"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/docs.deothemes.com\/blockst\/wp-json\/wp\/v2\/manualknowledgebasecat?post=1975"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/docs.deothemes.com\/blockst\/wp-json\/wp\/v2\/manual_kb_tag?post=1975"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}