{"id":41696,"date":"2024-02-05T10:06:46","date_gmt":"2024-02-05T10:06:46","guid":{"rendered":"https:\/\/s.b\/oikcom\/?post_type=block_example&#038;p=50258"},"modified":"2024-03-15T12:21:11","modified_gmt":"2024-03-15T12:21:11","slug":"acf-field-block-with-label","status":"publish","type":"block_example","link":"https:\/\/www.oik-plugins.com\/block_example\/acf-field-block-with-label\/","title":{"rendered":"ACF field block <span class=\"summary\">&#8211; with label<\/span>"},"content":{"rendered":"\n<p>This example demonstrates using the ACF field block&#8217;s <strong>Display label<\/strong> toggle.<\/p>\n\n\n\n<!--more-->\n\n\n<figure class=\"wp-block-post-featured-image\"><img loading=\"lazy\" decoding=\"async\" width=\"868\" height=\"325\" src=\"https:\/\/www.oik-plugins.com\/wp-content\/uploads\/2024\/02\/image-1.png\" class=\"attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"ACF field block Display label field\" style=\"object-fit:cover;\" srcset=\"https:\/\/www.oik-plugins.com\/wp-content\/uploads\/2024\/02\/image-1.png 868w, https:\/\/www.oik-plugins.com\/wp-content\/uploads\/2024\/02\/image-1-300x112.png 300w, https:\/\/www.oik-plugins.com\/wp-content\/uploads\/2024\/02\/image-1-334x125.png 334w, https:\/\/www.oik-plugins.com\/wp-content\/uploads\/2024\/02\/image-1-768x288.png 768w\" sizes=\"auto, (max-width: 868px) 100vw, 868px\" \/><\/figure>\n\n\n<h2 class=\"wp-block-heading\">Display label unchecked<\/h2>\n\n\n\n<p>When unchecked, which is the default, the field&#8217;s label is not displayed. <\/p>\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--20);margin-bottom:var(--wp--preset--spacing--20);\" class=\"acf-field-field_64aa869f48df7 acf-type-text has-text-align- align wp-block-acf-field-acf-field has-background has-lolive-background-color\">Which of these gets saved?<\/div>\n\n<div class=\"acf-field-field_64aa870148dfb acf-type-textarea has-text-align- align wp-block-acf-field-acf-field\">Which of these textarea fields gets saved<\/div>\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Display label checked<\/h2>\n\n\n\n<p>When checked, the field&#8217;s label and value are displayed in two divs, which can be styled separately using CSS.<\/p>\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--20);margin-bottom:var(--wp--preset--spacing--20);\" class=\"acf-field-field_64aa869f48df7 acf-type-text has-text-align- has-label align wp-block-acf-field-acf-field has-background has-lolive-background-color\"><div class=\"label\">Text<\/div><div class=\"value\">Which of these gets saved?<\/div><\/div>\n\n<div class=\"acf-field-field_64aa870148dfb acf-type-textarea has-text-align- has-label align wp-block-acf-field-acf-field\"><div class=\"label\">Text Area<\/div><div class=\"value\">Which of these textarea fields gets saved<\/div><\/div>\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Custom CSS using the CSS block<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Here we style the labels and values as a grid.<\/li>\n\n\n\n<li>We append a separator of &#8220;: &#8221; to each label.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-oik-css-css\"><div><style  type=\"text\/css\" media=\"screen,print\">div.site-inner div.wp-block-acf-field-acf-field.has-label { display: grid; grid-template-columns: 20% 80%; column-gap: 1rem; }\n.wp-block-acf-field-acf-field .label::after {\n    content: \": \";\n}\n.wp-block-acf-field-acf-field .label { font-weight: bold; }<\/style><div class=\"bw_css\"><code>div<span style=\"color: #6666ff;\">.site-inner<\/span> div<span style=\"color: #6666ff;\">.wp-block-acf-field-acf-field<\/span><span style=\"color: #6666ff;\">.has-label<\/span> <span style=\"color: #00AA00;\">&#123;<\/span> <span style=\"color: #000000; font-weight: bold;\">display<\/span><span style=\"color: #00AA00;\">:<\/span> grid<span style=\"color: #00AA00;\">;<\/span> <span style=\"color: #000000; font-weight: bold;\">grid-template-columns<\/span><span style=\"color: #00AA00;\">:<\/span> <span style=\"color: #933;\">20%<\/span> <span style=\"color: #933;\">80%<\/span><span style=\"color: #00AA00;\">;<\/span> <span style=\"color: #000000; font-weight: bold;\">column-gap<\/span><span style=\"color: #00AA00;\">:<\/span> <span style=\"color: #933;\">1rem<\/span><span style=\"color: #00AA00;\">;<\/span> <span style=\"color: #00AA00;\">&#125;<\/span><br \/>\n<span style=\"color: #6666ff;\">.wp-block-acf-field-acf-field<\/span> <span style=\"color: #6666ff;\">.label<\/span><span style=\"color: #00AA00;\">::<\/span><span style=\"color: #F5758F;\">after<\/span> <span style=\"color: #00AA00;\">&#123;<\/span><br \/>\n&nbsp; &nbsp; <span style=\"color: #000000; font-weight: bold;\">content<\/span><span style=\"color: #00AA00;\">:<\/span> <span style=\"color: #ff0000;\">&quot;: &quot;<\/span><span style=\"color: #00AA00;\">;<\/span><br \/>\n<span style=\"color: #00AA00;\">&#125;<\/span><br \/>\n<span style=\"color: #6666ff;\">.wp-block-acf-field-acf-field<\/span> <span style=\"color: #6666ff;\">.label<\/span> <span style=\"color: #00AA00;\">&#123;<\/span> <span style=\"color: #000000; font-weight: bold;\">font-weight<\/span><span style=\"color: #00AA00;\">:<\/span> <span style=\"color: #993333;\">bold<\/span><span style=\"color: #00AA00;\">;<\/span> <span style=\"color: #00AA00;\">&#125;<\/span><\/code><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p><!-- wp:paragraph --><\/p>\n<p>This example demonstrates using the ACF field block&#8217;s <strong>Display label<\/strong> toggle.<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:more --><\/p>\n","protected":false},"author":1,"featured_media":41698,"comment_status":"closed","ping_status":"closed","template":"","block_category":[],"block_letters":[645,617,611,619,618],"class_list":{"0":"post-41696","1":"block_example","2":"type-block_example","3":"status-publish","4":"has-post-thumbnail","6":"block_letters-a","7":"block_letters-b","8":"block_letters-f","9":"block_letters-l","10":"block_letters-w","11":"entry"},"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>ACF field block - with label - [oik] plugins.com<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.oik-plugins.com\/block_example\/acf-field-block-with-label\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ACF field block - with label - [oik] plugins.com\" \/>\n<meta property=\"og:description\" content=\"This example demonstrates using the ACF field block&#039;s Display label toggle.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.oik-plugins.com\/block_example\/acf-field-block-with-label\/\" \/>\n<meta property=\"og:site_name\" content=\"[oik] plugins.com\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-15T12:21:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.oik-plugins.com\/wp-content\/uploads\/2024\/02\/image-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"868\" \/>\n\t<meta property=\"og:image:height\" content=\"325\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.oik-plugins.com\/block_example\/acf-field-block-with-label\/\",\"url\":\"https:\/\/www.oik-plugins.com\/block_example\/acf-field-block-with-label\/\",\"name\":\"ACF field block - with label - [oik] plugins.com\",\"isPartOf\":{\"@id\":\"https:\/\/www.oik-plugins.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.oik-plugins.com\/block_example\/acf-field-block-with-label\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.oik-plugins.com\/block_example\/acf-field-block-with-label\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.oik-plugins.com\/wp-content\/uploads\/2024\/02\/image-1.png\",\"datePublished\":\"2024-02-05T10:06:46+00:00\",\"dateModified\":\"2024-03-15T12:21:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.oik-plugins.com\/block_example\/acf-field-block-with-label\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.oik-plugins.com\/block_example\/acf-field-block-with-label\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.oik-plugins.com\/block_example\/acf-field-block-with-label\/#primaryimage\",\"url\":\"https:\/\/www.oik-plugins.com\/wp-content\/uploads\/2024\/02\/image-1.png\",\"contentUrl\":\"https:\/\/www.oik-plugins.com\/wp-content\/uploads\/2024\/02\/image-1.png\",\"width\":868,\"height\":325,\"caption\":\"ACF field block Display label field\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.oik-plugins.com\/block_example\/acf-field-block-with-label\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Block examples\",\"item\":\"https:\/\/www.oik-plugins.com\/block_example\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ACF field block &#8211; with label\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.oik-plugins.com\/#website\",\"url\":\"https:\/\/www.oik-plugins.com\/\",\"name\":\"[oik] plugins.com\",\"description\":\"WordPress plugins and themes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.oik-plugins.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ACF field block - with label - [oik] plugins.com","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.oik-plugins.com\/block_example\/acf-field-block-with-label\/","og_locale":"en_US","og_type":"article","og_title":"ACF field block - with label - [oik] plugins.com","og_description":"This example demonstrates using the ACF field block's Display label toggle.","og_url":"https:\/\/www.oik-plugins.com\/block_example\/acf-field-block-with-label\/","og_site_name":"[oik] plugins.com","article_modified_time":"2024-03-15T12:21:11+00:00","og_image":[{"width":868,"height":325,"url":"https:\/\/www.oik-plugins.com\/wp-content\/uploads\/2024\/02\/image-1.png","type":"image\/png"}],"twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.oik-plugins.com\/block_example\/acf-field-block-with-label\/","url":"https:\/\/www.oik-plugins.com\/block_example\/acf-field-block-with-label\/","name":"ACF field block - with label - [oik] plugins.com","isPartOf":{"@id":"https:\/\/www.oik-plugins.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.oik-plugins.com\/block_example\/acf-field-block-with-label\/#primaryimage"},"image":{"@id":"https:\/\/www.oik-plugins.com\/block_example\/acf-field-block-with-label\/#primaryimage"},"thumbnailUrl":"https:\/\/www.oik-plugins.com\/wp-content\/uploads\/2024\/02\/image-1.png","datePublished":"2024-02-05T10:06:46+00:00","dateModified":"2024-03-15T12:21:11+00:00","breadcrumb":{"@id":"https:\/\/www.oik-plugins.com\/block_example\/acf-field-block-with-label\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.oik-plugins.com\/block_example\/acf-field-block-with-label\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.oik-plugins.com\/block_example\/acf-field-block-with-label\/#primaryimage","url":"https:\/\/www.oik-plugins.com\/wp-content\/uploads\/2024\/02\/image-1.png","contentUrl":"https:\/\/www.oik-plugins.com\/wp-content\/uploads\/2024\/02\/image-1.png","width":868,"height":325,"caption":"ACF field block Display label field"},{"@type":"BreadcrumbList","@id":"https:\/\/www.oik-plugins.com\/block_example\/acf-field-block-with-label\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Block examples","item":"https:\/\/www.oik-plugins.com\/block_example\/"},{"@type":"ListItem","position":2,"name":"ACF field block &#8211; with label"}]},{"@type":"WebSite","@id":"https:\/\/www.oik-plugins.com\/#website","url":"https:\/\/www.oik-plugins.com\/","name":"[oik] plugins.com","description":"WordPress plugins and themes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.oik-plugins.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.oik-plugins.com\/wp-json\/wp\/v2\/block_example\/41696","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oik-plugins.com\/wp-json\/wp\/v2\/block_example"}],"about":[{"href":"https:\/\/www.oik-plugins.com\/wp-json\/wp\/v2\/types\/block_example"}],"author":[{"embeddable":true,"href":"https:\/\/www.oik-plugins.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oik-plugins.com\/wp-json\/wp\/v2\/comments?post=41696"}],"version-history":[{"count":1,"href":"https:\/\/www.oik-plugins.com\/wp-json\/wp\/v2\/block_example\/41696\/revisions"}],"predecessor-version":[{"id":41699,"href":"https:\/\/www.oik-plugins.com\/wp-json\/wp\/v2\/block_example\/41696\/revisions\/41699"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.oik-plugins.com\/wp-json\/wp\/v2\/media\/41698"}],"wp:attachment":[{"href":"https:\/\/www.oik-plugins.com\/wp-json\/wp\/v2\/media?parent=41696"}],"wp:term":[{"taxonomy":"block_category","embeddable":true,"href":"https:\/\/www.oik-plugins.com\/wp-json\/wp\/v2\/block_category?post=41696"},{"taxonomy":"block_letters","embeddable":true,"href":"https:\/\/www.oik-plugins.com\/wp-json\/wp\/v2\/block_letters?post=41696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}