• Resolved kc1024

    (@kc1024)


    Hi,

    I have been experimenting with trying to use ACF blocks on Events pages, but they won’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’ve enabled the Gutenberg editor for events with define(‘EM_GUTENBERG’, true); in wp-config.php. I’ve created an ACF block that just prints out “Simple ACF block.” This is what I added to functions.php:

    `add_action(‘acf/init’, ‘register_custom_banner’);
    function register_custom_banner() {

    if(function_exists(‘acf_register_block_type’)) {
    acf_register_block_type(array(
    ‘name’ => ‘simple’,
    ‘title’ => __(‘Simple’),
    ‘description’ => __(‘A custom block.’),
    ‘render_template’ => ‘simple.php’,
    ‘category’ => ‘layout’,
    ‘icon’ => ‘format-image’,
    ‘keywords’ => array(‘custom’, ‘block’),
    ));
    }
    }`

    and this is simple.php:

    <?php
    echo “Simple ACF Block”;
    ?>

    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’t appear on the page itself. Is there any way to get ACF blocks working on Event pages?

    Kevin

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘ACF Blocks on Event pages’ is closed to new replies.