{"id":20022,"date":"2021-06-11T23:14:14","date_gmt":"2021-06-12T04:14:14","guid":{"rendered":"https:\/\/wpstackable.com\/?p=20022"},"modified":"2021-07-14T16:58:02","modified_gmt":"2021-07-14T21:58:02","slug":"custom-attributes-and-optimization","status":"publish","type":"post","link":"https:\/\/wpstackable.com\/blog\/custom-attributes-and-optimization\/","title":{"rendered":"New in Stackable: Custom Attributes &#038; Optimization"},"content":{"rendered":"\n<p data-block-type=\"core\">This latest update includes a Custom Attributes, a new way to optimize your site, and some important fixes. Update to Stackable v2.17 now!<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\" data-block-type=\"core\">Custom Attributes<\/h2>\n\n\n\n<p data-block-type=\"core\">We\u2019ve added a section in the Advanced tab of the Inspector wherein you can add custom attributes to each block. This field will allow you to add custom attributes that are not already in use in the markup of each block.&nbsp;<\/p>\n\n\n\n<div class=\"wp-block-image\" data-block-type=\"core\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/wpstackable.com\/wp-content\/uploads\/2021\/06\/image-1.png\" alt=\"\" class=\"wp-image-20030\" width=\"447\" height=\"277\" srcset=\"https:\/\/wpstackable.com\/wp-content\/uploads\/2021\/06\/image-1.png 548w, https:\/\/wpstackable.com\/wp-content\/uploads\/2021\/06\/image-1-300x186.png 300w\" sizes=\"auto, (max-width: 447px) 100vw, 447px\" \/><figcaption>Custom Attributes in the inspector<\/figcaption><\/figure><\/div>\n\n\n\n<p data-block-type=\"core\">Here are some things you can do or achieve using custom attributes:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" data-block-type=\"core\">Gain more control over accessibility<\/h3>\n\n\n\n<p data-block-type=\"core\">You can add ARIA attributes to your block, which give you the ability to define string values that label various elements on your website. ARIA attributes were especially designed for assistive technology, such as screen readers.<\/p>\n\n\n\n<p data-block-type=\"core\">You can also add an <code>id<\/code> attribute to a header block (e.g. <code>product-features<\/code>) then reference it as a custom attribute of a block containing the content for the header (e.g. <code>aria-labelledby=\"product-features\"<\/code>)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" data-block-type=\"core\">Add any custom data<\/h3>\n\n\n\n<p data-block-type=\"core\">Attach any type of data to your block (e.g. <code>data-my-custom-attribute=\"some-value\"<\/code> or <code>data-id=\"12345\"<\/code>)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" data-block-type=\"core\">Create great looking effects<\/h3>\n\n\n\n<p data-block-type=\"core\">You can use it in conjunction with CSS&#8217;s&nbsp;&nbsp;<code>attr()<\/code>&nbsp;function to create some great looking effects<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" data-block-type=\"core\">New Optimization Settings<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\" data-block-type=\"core\"><img loading=\"lazy\" decoding=\"async\" width=\"898\" height=\"217\" src=\"https:\/\/wpstackable.com\/wp-content\/uploads\/2021\/06\/optimization-settings-stackable.gif\" alt=\"\" class=\"wp-image-20039\"\/><\/figure>\n\n\n\n<p data-block-type=\"core\">While Stackable <a rel=\"noreferrer noopener\" href=\"https:\/\/docs.wpstackable.com\/article\/373-how-does-stackable-affect-my-page-loading-speed\" data-type=\"URL\" data-id=\"https:\/\/docs.wpstackable.com\/article\/373-how-does-stackable-affect-my-page-loading-speed\" target=\"_blank\">doesn&#8217;t affect your website&#8217;s page loading speed<\/a> that much since majority of our blocks do not require any server-side PHP processing, we&#8217;d still like to give you further control over how Stackable blocks are loaded on your website.<\/p>\n\n\n\n<p data-block-type=\"core\">In an effort to help your websites perform better, we&#8217;ve added a setting where you are given the option to load Stackable&#8217;s frontend JavaScript and CSS files only on pages and posts that have Stackable blocks <em>OR<\/em> on your entire site.<\/p>\n\n\n\n<p data-block-type=\"core\">Stackable&#8217;s JavaScript and CSS files are loaded across entire websites by default. If you want to toggle this setting on or off, go to the Stackable settings from the WordPress dashboard by hovering over <strong>Settings<\/strong> on the left menu panel and clicking <strong>Stackable<\/strong>.<\/p>\n\n\n\n<p data-block-type=\"core\">You will then see the new <strong>Optimization Settings<\/strong>. Simply toggle the new setting depending on your preference and your settings will be saved!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" data-block-type=\"core\">Other fixes<\/h2>\n\n\n\n<ul class=\"wp-block-list\" data-block-type=\"core\"><li>Fixed a block error when switching responsiveness modes while global colors is empty<\/li><li>Issues with the alignment in the icon block is now working properly<\/li><li>Review stars from WP Review Pro now appear properly in the Posts block<\/li><li>Increased cap for the block paddings<\/li><li>Fixed an issue where the alt text for featured images in the Posts block was pulling the wrong information<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" data-block-type=\"core\">Final Words<\/h2>\n\n\n\n<p data-block-type=\"core\">We appreciate all Stackable users and so we&#8217;re always working to make sure you are able to make the most out of Stackable! If you want to read more about this new feature, read our documentation on <a href=\"https:\/\/docs.wpstackable.com\/article\/461-how-to-use-custom-attributes\" data-type=\"URL\" data-id=\"https:\/\/docs.wpstackable.com\/article\/461-how-to-use-custom-attributes\" target=\"_blank\" rel=\"noreferrer noopener\">Custom Attributes<\/a> and the new <a href=\"https:\/\/docs.wpstackable.com\/article\/460-how-to-use-optimization-settings\" data-type=\"URL\" data-id=\"https:\/\/docs.wpstackable.com\/article\/460-how-to-use-optimization-settings\" target=\"_blank\" rel=\"noreferrer noopener\">optimization<\/a> settings.<\/p>\n\n\n\n<p data-block-type=\"core\">We hope you enjoy this release. If you have any additional questions, don&#8217;t hesitate to <a href=\"mailto:support@wpstackable.com\" data-type=\"mailto\" data-id=\"mailto:support@wpstackable.com\">reach out<\/a> to us!<\/p>\n\n\n\n<div class=\"aligncenter wp-block-ugb-cta ugb-cta ugb-de2a73a ugb-cta ugb-cta--v2 ugb-main-block\" data-block-type=\"core\"><style>.ugb-de2a73a .ugb-cta__title,.ugb-de2a73a .ugb-cta__description,.ugb-de2a73a .ugb-button-container{text-align:left !important}.ugb-de2a73a .ugb-cta__item{background-image:url(https:\/\/wpstackable.com\/wp-content\/uploads\/2021\/04\/Learn-CTA.png)}.ugb-de2a73a .ugb-cta__item:before{opacity:0.5}.ugb-de2a73a .ugb-cta__title{font-size:48px !important;font-weight:500 !important;color:#ffffff}.ugb-de2a73a .ugb-cta__description{margin-bottom:32px !important;color:#ffffff}.ugb-de2a73a .ugb-button .ugb-button--inner{font-family:\"DM Sans\",Sans-serif !important;font-weight:400 !important}.ugb-de2a73a .ugb-button{background-color:#ffffff;border-radius:0px !important}.ugb-de2a73a .ugb-button .ugb-button--inner,.ugb-de2a73a .ugb-button svg:not(.ugb-custom-icon){color:var(--stk-global-color-43441,#111111) !important}.ugb-de2a73a .ugb-button:before{border-radius:0px !important}.ugb-de2a73a .ugb-inner-block{text-align:left}<\/style><div class=\"ugb-inner-block\"><div class=\"ugb-block-content\"><div class=\"ugb-cta__item ugb--has-background-overlay\"><h3 class=\"ugb-cta__title\">Want to learn more <br>about Stackable?<\/h3><p class=\"ugb-cta__description\">Your very own Learning Hub for all things WordPress and Stackable. Find the right resources to help get you started as you begin building your online presence with Stackable.<\/p><div class=\"ugb-button-container\"><a class=\"ugb-button ugb-button--size-normal ugb--shadow-3 ugb-button--has-icon ugb-button--icon-position-right\" href=\"\" rel=\"\" title=\"\"><div class=\"ugb-icon-inner-svg\"><svg data-prefix=\"fas\" data-icon=\"arrow-right\" class=\"svg-inline--fa fa-arrow-right fa-w-14\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 448 512\"><path fill=\"currentColor\" d=\"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z\"><\/path><\/svg><\/div><span class=\"ugb-button--inner\">Go to Stackable Learn<\/span><\/a><\/div><\/div><\/div><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>This latest update includes a Custom Attributes, a new way to optimize your site, and some important fixes. Update to Stackable v2.17 now!<\/p>\n","protected":false},"author":18,"featured_media":20049,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"_lmt_disableupdate":"no","_lmt_disable":"no","footnotes":""},"categories":[3],"tags":[],"class_list":{"0":"post-20022","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"hentry","7":"category-updates"},"featured_image_urls_v2":{"full":["https:\/\/wpstackable.com\/wp-content\/uploads\/2021\/06\/Custom-Attributes.jpg",1200,624,false]},"post_excerpt_stackable_v2":"<p>This latest update includes a Custom Attributes, a new way to optimize your site, and some important fixes. Update to Stackable v2.17 now! Custom Attributes We\u2019ve added a section in the Advanced tab of the Inspector wherein you can add custom attributes to each block. This field will allow you to add custom attributes that are not already in use in the markup of each block.&nbsp; Custom Attributes in the inspector Here are some things you can do or achieve using custom attributes: Gain more control over accessibility You can add ARIA attributes to your block, which give you the&hellip;<\/p>\n","category_list_v2":"<a href=\"https:\/\/wpstackable.com\/blog\/category\/updates\/\" rel=\"category tag\">Updates<\/a>","author_info_v2":{"name":"Alexandra Yap","url":"https:\/\/wpstackable.com\/blog\/author\/alex\/"},"comments_num_v2":"0 comments","acf":[],"modified_by":"Alexandra Yap","_links":{"self":[{"href":"https:\/\/wpstackable.com\/wp-json\/wp\/v2\/posts\/20022","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpstackable.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpstackable.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpstackable.com\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/wpstackable.com\/wp-json\/wp\/v2\/comments?post=20022"}],"version-history":[{"count":1,"href":"https:\/\/wpstackable.com\/wp-json\/wp\/v2\/posts\/20022\/revisions"}],"predecessor-version":[{"id":20629,"href":"https:\/\/wpstackable.com\/wp-json\/wp\/v2\/posts\/20022\/revisions\/20629"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpstackable.com\/wp-json\/wp\/v2\/media\/20049"}],"wp:attachment":[{"href":"https:\/\/wpstackable.com\/wp-json\/wp\/v2\/media?parent=20022"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpstackable.com\/wp-json\/wp\/v2\/categories?post=20022"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpstackable.com\/wp-json\/wp\/v2\/tags?post=20022"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}