{"id":14366247,"date":"2021-04-26T15:01:07","date_gmt":"2021-04-26T15:01:07","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/acf-blocks-on-event-pages\/"},"modified":"2021-04-26T15:01:07","modified_gmt":"2021-04-26T15:01:07","slug":"acf-blocks-on-event-pages","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/acf-blocks-on-event-pages\/","title":{"rendered":"ACF Blocks on Event pages"},"content":{"rendered":"<p>Hi,<\/p>\n<p>I have been experimenting with trying to use ACF blocks on Events pages, but they won&#8217;t render.  I have an install of version 5.7.1 of WordPress with the 2021 theme.  The only two plugins I have installed are Events Manager (v. 5.9.11.3) and Advanced Custom Fields Pro (v. 5.9.5).  I&#8217;ve enabled the Gutenberg editor for events with define(&#8216;EM_GUTENBERG&#8217;, true); in wp-config.php.  I&#8217;ve created an ACF block that just prints out &#8220;Simple ACF block.&#8221;  This is what I added to functions.php:<\/p>\n<p> `add_action(&#8216;acf\/init&#8217;, &#8216;register_custom_banner&#8217;);<br \/>\nfunction register_custom_banner() {<\/p>\n<p>   if(function_exists(&#8216;acf_register_block_type&#8217;)) {<br \/>\n      acf_register_block_type(array(<br \/>\n         &#8216;name&#8217; =&gt; &#8216;simple&#8217;,<br \/>\n         &#8216;title&#8217; =&gt; __(&#8216;Simple&#8217;),<br \/>\n         &#8216;description&#8217; =&gt; __(&#8216;A custom block.&#8217;),<br \/>\n         &#8216;render_template&#8217; =&gt; &#8216;simple.php&#8217;,<br \/>\n         &#8216;category&#8217; =&gt; &#8216;layout&#8217;,<br \/>\n         &#8216;icon&#8217; =&gt; &#8216;format-image&#8217;,<br \/>\n         &#8216;keywords&#8217; =&gt; array(&#8216;custom&#8217;, &#8216;block&#8217;),<br \/>\n      ));<br \/>\n   }<br \/>\n}` <\/p>\n<p>and this is simple.php:<\/p>\n<p>&lt;?php<br \/>\necho &#8220;Simple ACF Block&#8221;;<br \/>\n?&gt;<\/p>\n<p>The block works when I insert in in a post.  When I insert in on an event page, it renders in the editor, but doesn&#8217;t appear on the page itself.  Is there any way to get ACF blocks working on Event pages?<\/p>\n<p>Kevin<\/p>\n","protected":false},"template":"","class_list":["post-14366247","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14366247","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14366247\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=14366247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}