{"id":1622,"date":"2021-01-18T20:35:36","date_gmt":"2021-01-18T18:35:36","guid":{"rendered":"https:\/\/creativethemes.com\/blocksy\/?post_type=documentation&#038;p=1622"},"modified":"2024-01-09T17:29:04","modified_gmt":"2024-01-09T15:29:04","slug":"custom-code-snippets","status":"publish","type":"documentation","link":"https:\/\/creativethemes.com\/blocksy\/docs\/extensions\/custom-code-snippets\/","title":{"rendered":"Custom Code Snippets"},"content":{"rendered":"\n<figure class=\"wp-block-video\"><video autoplay loop muted preload=\"auto\" src=\"https:\/\/creativethemes.com\/blocksy\/wp-content\/uploads\/2021\/01\/Screen-Recording-2021-10-21-at-22.27.09.mov\"><\/video><figcaption class=\"wp-element-caption\">Enabling the Custom Code Snippets<\/figcaption><\/figure>\n\n\n\n<p>Enabling the <strong>Custom Code Snippets Extension<\/strong> is simple. Go to the <strong>Blocksy Dashboard -&gt; Extensions -&gt; Pro Extensions -&gt; Custom Code Snippets<\/strong>.<\/p>\n\n\n\n<p>This extension allows you to add <strong>JavaScript<\/strong> or <strong>CSS<\/strong> code snippets to your website. You can add them globally, so they affect all the areas of your website, or on a per page\/post basis, so they affect just that special section of your website.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Global Snippets<\/h2>\n\n\n\n<p>To add a <em>Global<\/em> Code Snippet, simply navigate to the <strong>Customiser -&gt; Extension -&gt; Custom Code Snippets<\/strong> section. Everything you add here is executed throughout the whole website. It&#8217;s useful in case you wish to add things such as <em>Google Tag Manager<\/em>.<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video autoplay loop muted preload=\"auto\" src=\"https:\/\/creativethemes.com\/blocksy\/wp-content\/uploads\/2021\/01\/Screen-Recording-2021-10-21-at-22.29.08.mov\"><\/video><figcaption class=\"wp-element-caption\">Global Code Snippets<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Per Page\/Post Snippets<\/h2>\n\n\n\n<p>You can also add snippets just on that special part of your website, like a page or a post. For example, you could add <em>Facebook Pixel Tracking<\/em> on the &#8220;Thank You&#8221; page at the end of a transaction.<\/p>\n\n\n\n<p>Simply edit the page or post with Gutenberg, click on the Blocksy settings in the top right corner of the screen and choose Custom Code Snippets.<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video autoplay loop muted preload=\"auto\" src=\"https:\/\/creativethemes.com\/blocksy\/wp-content\/uploads\/2021\/01\/Screen-Recording-2021-10-21-at-22.32.55.mov\"><\/video><figcaption class=\"wp-element-caption\">Per Page\/Post Code Snippets<\/figcaption><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity is-style-wide\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Related Material<\/h2>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Integrating Powerful Analytical Tools | Blocksy Integrations\" width=\"1290\" height=\"968\" src=\"https:\/\/www.youtube.com\/embed\/EzBWrB3O_bs?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Enabling the Custom Code Snippets Extension is simple. Go to the Blocksy Dashboard -&gt; Extensions -&gt; Pro Extensions -&gt; Custom Code Snippets. This extension allows you to add JavaScript or CSS code snippets to your website. You can add them globally, so they affect all the areas of your website, or on a per page\/post [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"doc_categories":[116],"class_list":["post-1622","documentation","type-documentation","status-publish","hentry","doc_categories-extensions"],"blocksy_meta":{"post_title_panel":"","has_hero_section":"default","9d1fde5cec6e5c4eaa9342469f487d22":"","hero_section":"type-1","hero_elements":[{"id":"custom_title","enabled":true,"heading_tag":"h1","title":"Home"},{"id":"custom_description","enabled":true,"description_visibility":{"desktop":true,"tablet":true,"mobile":false}},{"id":"custom_meta","enabled":true,"meta_elements":[{"id":"author","enabled":true,"label":"By","has_author_avatar":"yes","avatar_size":25},{"id":"post_date","enabled":true,"label":"On","date_format_source":"default","date_format":"M j, Y"},{"id":"categories","enabled":true,"label":"In","style":"simple"},{"id":"comments","enabled":true}],"page_meta_elements":{"joined":true,"articles_count":true,"comments":true}},{"id":"breadcrumbs","enabled":false}],"0983a0d13cd62694e9ec4ebbafe309b9":"","hero_alignment1":"left","hero_margin":{"desktop":50,"tablet":30,"mobile":30},"hero_alignment2":"center","hero_vertical_alignment":"center","17fe5f79f257c5e8820b507cc34195b0":"","hero_structure":"narrow","1c7a1bf81f9caa0d7cf441746c23d2cd":"","page_title_bg_type":"featured_image","custom_hero_background":{"attachment_id":null},"parallax":{"desktop":false,"tablet":false,"mobile":false},"7a05dd5f5831e3e6e0bd5321a9fcbeb0":"","hero_height":"250px","pageTitleFont":{"family":"Default","variation":"Default","size":{"desktop":"32px","tablet":"30px","mobile":"25px"},"line-height":"CT_CSS_SKIP_RULE","letter-spacing":"CT_CSS_SKIP_RULE","text-transform":"CT_CSS_SKIP_RULE","text-decoration":"CT_CSS_SKIP_RULE"},"pageTitleFontColor":{"default":{"color":"CT_CSS_SKIP_RULEDEFAULT"}},"pageMetaFont":{"family":"Default","variation":"n6","size":"12px","line-height":"1.3","letter-spacing":"CT_CSS_SKIP_RULE","text-transform":"uppercase","text-decoration":"CT_CSS_SKIP_RULE"},"pageMetaFontColor":{"default":{"color":"CT_CSS_SKIP_RULEDEFAULT"},"hover":{"color":"CT_CSS_SKIP_RULEDEFAULT"}},"pageExcerptFont":{"family":"Default","variation":"Default","size":"CT_CSS_SKIP_RULE","line-height":"CT_CSS_SKIP_RULE","letter-spacing":"CT_CSS_SKIP_RULE","text-transform":"CT_CSS_SKIP_RULE","text-decoration":"CT_CSS_SKIP_RULE"},"pageExcerptColor":{"default":{"color":"CT_CSS_SKIP_RULEDEFAULT"}},"breadcrumbsFont":{"family":"Default","variation":"n6","size":"12px","line-height":"CT_CSS_SKIP_RULE","letter-spacing":"CT_CSS_SKIP_RULE","text-transform":"uppercase","text-decoration":"CT_CSS_SKIP_RULE"},"breadcrumbsFontColor":{"default":{"color":"CT_CSS_SKIP_RULEDEFAULT"},"initial":{"color":"CT_CSS_SKIP_RULEDEFAULT"},"hover":{"color":"CT_CSS_SKIP_RULEDEFAULT"}},"pageTitleOverlay":{"default":{"color":"CT_CSS_SKIP_RULE"}},"pageTitleBackground":{"background_type":"color","background_pattern":"type-1","background_image":{"attachment_id":null,"x":0,"y":0},"gradient":"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)","background_repeat":"no-repeat","background_size":"auto","background_attachment":"scroll","patternColor":{"default":{"color":"#e5e7ea"}},"overlayColor":{"default":{"color":"CT_CSS_SKIP_RULE"}},"backgroundColor":{"default":{"color":"#EDEFF2"}}},"21315dc35455b32a87707a7e7bf86c67":"","page_structure_type":"default","content_style":"inherit","vertical_spacing_source":"inherit","content_area_spacing":"both","background":{"background_type":"color","background_pattern":"type-1","background_image":{"attachment_id":null,"x":0,"y":0},"gradient":"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)","background_repeat":"no-repeat","background_size":"auto","background_attachment":"scroll","patternColor":{"default":{"color":"#e5e7ea"}},"overlayColor":{"default":{"color":"CT_CSS_SKIP_RULE"}},"backgroundColor":{"default":{"color":"CT_CSS_SKIP_RULE"}}},"content_background":{"background_type":"color","background_pattern":"type-1","background_image":{"attachment_id":null,"x":0,"y":0},"gradient":"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)","background_repeat":"no-repeat","background_size":"auto","background_attachment":"scroll","patternColor":{"default":{"color":"#e5e7ea"}},"overlayColor":{"default":{"color":"CT_CSS_SKIP_RULE"}},"backgroundColor":{"default":{"color":"#ffffff"}}},"content_boxed_shadow":{"inherit":false,"blur":18,"spread":-6,"v_offset":12,"h_offset":0,"inset":false,"enable":true,"color":{"color":"rgba(34, 56, 101, 0.04)"}},"boxed_content_spacing":{"desktop":{"top":"40px","bottom":"40px","left":"40px","right":"40px","linked":true},"tablet":{"top":"35px","bottom":"35px","left":"35px","right":"35px","linked":true},"mobile":{"top":"20px","bottom":"20px","left":"20px","right":"20px","linked":true}},"content_boxed_radius":{"top":"3px","bottom":"3px","left":"3px","right":"3px","linked":true},"8dca87cb61bb883b77cf3a6b977d53f8":"","disable_featured_image":"no","disable_share_box":"no","disable_author_box":"no","disable_posts_navigation":"no","a69aa765b7c61a06d4d1b95c62b31412":"","disable_related_posts":"no","disable_header":"no","disable_footer":"no","docs_item_badge":"PRO","styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"acf":[],"_links":{"self":[{"href":"https:\/\/creativethemes.com\/blocksy\/wp-json\/wp\/v2\/documentation\/1622","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/creativethemes.com\/blocksy\/wp-json\/wp\/v2\/documentation"}],"about":[{"href":"https:\/\/creativethemes.com\/blocksy\/wp-json\/wp\/v2\/types\/documentation"}],"author":[{"embeddable":true,"href":"https:\/\/creativethemes.com\/blocksy\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/creativethemes.com\/blocksy\/wp-json\/wp\/v2\/comments?post=1622"}],"version-history":[{"count":2,"href":"https:\/\/creativethemes.com\/blocksy\/wp-json\/wp\/v2\/documentation\/1622\/revisions"}],"predecessor-version":[{"id":9182,"href":"https:\/\/creativethemes.com\/blocksy\/wp-json\/wp\/v2\/documentation\/1622\/revisions\/9182"}],"wp:attachment":[{"href":"https:\/\/creativethemes.com\/blocksy\/wp-json\/wp\/v2\/media?parent=1622"}],"wp:term":[{"taxonomy":"doc_categories","embeddable":true,"href":"https:\/\/creativethemes.com\/blocksy\/wp-json\/wp\/v2\/doc_categories?post=1622"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}