Skip to content

First custom block added to a post renders fields in sidebar instead of main well, before save/refresh #1020

Description

@annafractuous

Describe the bug
When inserting a custom ACF block into a post that contains no other custom ACF blocks, the block's fields render in the right-rail Block panel instead of inline in the editor canvas. All subsequently added blocks (of any ACF block type) render correctly in the canvas. The affected block also renders correctly after refreshing the page.

To reproduce
Open any post that contains no custom ACF blocks
Insert a custom ACF block (that was registered with 'mode' => 'auto')
Observe that block fields render in the right-rail Block panel, not in the editor canvas
Insert any second custom ACF block
Observe that the second block's fields render correctly in the editor canvas
Refresh the page — the first block now also renders correctly

The behavior is the same across block types: whichever block is inserted first exhibits the bug, regardless of type.

Expected behavior
All custom ACF block fields render in the editor canvas, consistently, on first insertion.

Screenshots or Video

first custom block in post:
Image

same block added second:
Image

Code

<?php
/**
 *  Conveyor Gallery Block
 */

add_action('acf/init', 'row_init_block_conveyor');

function row_init_block_conveyor() {
	if( function_exists('acf_register_block_type') ) {
		acf_register_block_type(array(
			'name'            => 'conveyor-gallery',
			'title'           => __('Conveyor Gallery'),
			'description'     => __('Insert scrolling text / sticky image gallery.'),
			'render_template' => 'admin/blocks/templates/conveyor-gallery-tpl.php',
			'category'        => 'media',
			'icon'            => 'id',
			'keywords'        => array('conveyor', 'gallery', 'sift', 'sticky', 'scrolly'),
			'supports'        => array(
				'color' => array(
					'text' => false,
					'background' => true,
					'gradients' => false
				), 
			),
			'mode' => 'auto'
		));
	}
}

if( function_exists('acf_add_local_field_group') ):

	$text_size_field = array(
		'key' => 'field_block_dd_1100',
		'label' => 'Text Size',
		'name' => 'text_size',
		'type' => 'button_group',
		'instructions' => '',
		'required' => 0,
		'conditional_logic' => 0,
		'choices' => array(
			'medium' => 'Medium',
			'large'  => 'Large',
			'xlarge' => 'X-Large',
		),
		'allow_null' => 0,
		'default_value' => 'medium',
		'layout' => 'horizontal',
		'return_format' => 'value'
	);

	$text_align_field = array(
		'key' => 'field_block_dd_1400',
		'label' => 'Text Alignment',
		'name' => 'text_alignment',
		'type' => 'button_group',
		'instructions' => '',
		'required' => 0,
		'conditional_logic' => 0,
		'choices' => array(
			'left'   => 'Left',
			'right'  => 'Right',
			'center' => 'Center',
		),
		'allow_null' => 0,
		'default_value' => 'center',
		'layout' => 'horizontal',
		'return_format' => 'value'
	);

	$text_background_field = array(
		'key' => 'field_block_dd_1200',
		'label' => 'Text Background',
		'name' => 'text_background',
		'type' => 'true_false',
		'instructions' => '',
		'required' => 0,
		'conditional_logic' => 0,
		'message' => '',
		'default_value' => 0,
		'ui' => 1,
		'ui_on_text' => 'On',
		'ui_off_text' => 'Off'
	);

	$background_color_field = array(
		'key' => 'field_block_dd_1300',
		'label' => 'Background Color',
		'name' => 'screen_background',
		'type' => 'button_group',
		'instructions' => '',
		'required' => 0,
		'conditional_logic' => 0,
		'choices' => array(
			'black' => 'Black',
			'grey' => 'Grey',
			'body' => 'Body',
		),
		'allow_null' => 0,
		'default_value' => '',
		'layout' => 'horizontal',
		'return_format' => 'value'
	);

	$media_type_field = array(
		'key' => 'field_block_dd_2100',
		'label' => 'Media',
		'name' => 'media',
		'type' => 'button_group',
		'instructions' => '',
		'required' => 0,
		'conditional_logic' => 0,
		'choices' => array(
			'image' => 'Image',
			'video' => 'Video',
		),
		'allow_null' => 0,
		'default_value' => 'image',
		'layout' => 'horizontal',
		'return_format' => 'value'
	);

	$img_field = array(
		'key' => 'field_block_dd_2200',
		'label' => 'Image',
		'name' => 'image',
		'type' => 'image',
		'instructions' => '',
		'required' => 1,
		'conditional_logic' => array(
			array(
				array(
					'field' => 'field_block_dd_2100',
					'operator' => '==',
					'value' => 'image',
				),
			),
		),
		'return_format' => 'array',
		'preview_size' => 'thumbnail',
		'library' => 'all'
	);

	$mobile_img_field = array(
		'key' => 'field_block_dd_2300',
		'label' => 'Mobile Image',
		'name' => 'mobile_image',
		'type' => 'image',
		'instructions' => '',
		'required' => 0,
		'conditional_logic' => array(
			array(
				array(
					'field' => 'field_block_dd_2100',
					'operator' => '==',
					'value' => 'image',
				),
			),
		),
		'return_format' => 'array',
		'preview_size' => 'thumbnail',
		'library' => 'all'
	);

	$video_type_field = array(
		'key' => 'field_block_dd_2400',
		'label' => 'Video Source',
		'name' => 'video_source',
		'type' => 'button_group',
		'instructions' => '',
		'required' => 0,
		'conditional_logic' => array(
			array(
				array(
					'field' => 'field_block_dd_2100',
					'operator' => '==',
					'value' => 'video',
				),
			),
		),
		'choices' => array(
			'vimeo'     => 'Vimeo',
			'wordpress' => 'WordPress',
		),
		'allow_null' => 0,
		'default_value' => 'vimeo',
		'layout' => 'horizontal',
		'return_format' => 'value',
	);

	$landscape_vimeo_field = array(
		'key' => 'field_block_dd_2500',
		'label' => 'Landscape Video',
		'name' => 'landscape_video_vimeo',
		'type' => 'url',
		'instructions' => '',
		'required' => 0,
		'conditional_logic' => array(
			array(
			array(
				'field' => 'field_block_dd_2100',
				'operator' => '==',
				'value' => 'video',
			),
			array(
				'field' => 'field_block_dd_2400',
				'operator' => '==',
				'value' => 'vimeo',
			),
			),
		),
		'default_value' => '',
		'placeholder' => ''
	);

	$landscape_vimeo_ratio_field = array(
		'key' => 'field_block_dd_2550',
		'label' => 'Aspect Ratio',
		'name' => 'landscape_vimeo_aspect_ratio',
		'type' => 'select',
		'instructions' => '',
		'required' => 1,
		'conditional_logic' => 0,
		'wrapper' => array(
			'width' => '',
			'class' => '',
			'id' => '',
		),
		'choices' => array(
			'16x9' => '16:9',
			'4x3' => '4:3',
			'1x1' => '1:1',
		),
		'conditional_logic' => array(
			array(
			array(
				'field' => 'field_block_dd_2100',
				'operator' => '==',
				'value' => 'video',
			),
			array(
				'field' => 'field_block_dd_2400',
				'operator' => '==',
				'value' => 'vimeo',
			),
			array(
				'field' => 'field_block_dd_2500',
				'operator' => '!=',
				'value' => '',
			),
			),
		),
		'default_value' => false,
		'allow_null' => 0,
		'multiple' => 0,
		'ui' => 0,
		'return_format' => 'value',
		'ajax' => 0,
		'placeholder' => ''
	);

	$portrait_vimeo_field = array(
		'key' => 'field_block_dd_2600',
		'label' => 'Portrait Video',
		'name' => 'portrait_video_vimeo',
		'type' => 'url',
		'instructions' => '',
		'required' => 0,
		'conditional_logic' => array(
			array(
				array(
					'field' => 'field_block_dd_2100',
					'operator' => '==',
					'value' => 'video',
				),
				array(
					'field' => 'field_block_dd_2400',
					'operator' => '==',
					'value' => 'vimeo',
				),
			),
		),
		'default_value' => '',
		'placeholder' => ''
	);

	$portrait_vimeo_ratio_field = array(
		'key' => 'field_block_dd_2650',
		'label' => 'Aspect Ratio',
		'name' => 'portrait_vimeo_aspect_ratio',
		'type' => 'select',
		'instructions' => '',
		'required' => 1,
		'conditional_logic' => 0,
		'wrapper' => array(
			'width' => '',
			'class' => '',
			'id' => '',
		),
		'choices' => array(
			'9x16' => '9:16',
			'6x13' => '6:13',
			'4x5' => '4:5'
		),
		'conditional_logic' => array(
			array(
				array(
					'field' => 'field_block_dd_2100',
					'operator' => '==',
					'value' => 'video',
				),
				array(
					'field' => 'field_block_dd_2400',
					'operator' => '==',
					'value' => 'vimeo',
				),
				array(
					'field' => 'field_block_dd_2600',
					'operator' => '!=',
					'value' => '',
				),
			),
		),
		'default_value' => false,
		'allow_null' => 0,
		'multiple' => 0,
		'ui' => 0,
		'return_format' => 'value',
		'ajax' => 0,
		'placeholder' => ''
	);

	$landscape_wp_field = array(
		'key' => 'field_block_dd_2700',
		'label' => 'Landscape Video',
		'name' => 'landscape_video_wordpress',
		'type' => 'file',
		'instructions' => '',
		'required' => 0,
		'conditional_logic' => array(
			array(
				array(
					'field' => 'field_block_dd_2100',
					'operator' => '==',
					'value' => 'video',
				),
				array(
					'field' => 'field_block_dd_2400',
					'operator' => '==',
					'value' => 'wordpress',
				),
			),
		),
		'return_format' => 'array',
		'library' => 'all',
		'min_size' => '',
		'max_size' => '',
		'mime_types' => 'mp4'
	);

	$portrait_wp_field = array(
		'key'   => 'field_block_dd_2800',
		'label' => 'Portrait Video',
		'name'  => 'portrait_video_wordpress',
		'type'  => 'file',
		'instructions' => '',
		'required' => 0,
		'conditional_logic' => array(
			array(
				array(
					'field' => 'field_block_dd_2100',
					'operator' => '==',
					'value' => 'video',
				),
				array(
					'field' => 'field_block_dd_2400',
					'operator' => '==',
					'value' => 'wordpress',
				),
			),
		),
		'return_format' => 'array',
		'library' => 'all',
		'min_size' => '',
		'max_size' => '',
		'mime_types' => 'mp4'
	);

	$text_field = array(
		'key' => 'field_block_dd_2900',
		'label' => 'Text',
		'name' => 'text',
		'type' => 'textarea',
		'instructions' => '',
		'required' => 1,
		'conditional_logic' => 0,
		'maxlength' => ''
	);

	acf_add_local_field_group(array(
		'key' => 'group_100e1000e1000',
		'title' => 'Conveyor Gallery',
		'fields' => array(
			array(
				'key' => 'field_block_dd_1000',
				'label' => 'Appearance',
				'name' => 'appearance',
				'type' => 'group',
				'instructions' => '',
				'required' => 0,
				'conditional_logic' => 0,
				'wrapper' => array(
					'width' => '',
					'class' => '',
					'id' => '',
				),
				'layout' => 'row',
				'sub_fields' => array(
					$text_size_field,
					$text_align_field,
					$text_background_field,
					$background_color_field,
				),
			),
			array(
				'key' => 'field_block_dd_2000',
				'label' => 'Screens',
				'name' => 'screens',
				'type' => 'repeater',
				'instructions' => '',
				'required' => 0,
				'conditional_logic' => 0,
				'wrapper' => array(
					'width' => '',
					'class' => '',
					'id' => '',
				),
				'collapsed' => 'field_block_dd_2900',
				'min' => 2,
				'max' => 0,
				'layout' => 'row',
				'button_label' => 'Add Screen',
				'sub_fields' => array(
					$media_type_field,
					$img_field,
					$mobile_img_field,
					$video_type_field,
					$landscape_vimeo_field,
					$landscape_vimeo_ratio_field,
					$portrait_vimeo_field,
					$portrait_vimeo_ratio_field,
					$landscape_wp_field,
					$portrait_wp_field,
					$text_field,
				),
			),
		),
		'location' => array(
			array(
				array(
					'param' => 'block',
					'operator' => '==',
					'value' => 'acf/conveyor-gallery',
				),
			),
		),
		'menu_order' => 0,
		'position' => 'normal',
		'style' => 'default',
		'label_placement' => 'top',
		'instruction_placement' => 'label',
		'hide_on_screen' => ''
	));

endif;

Version Information

WordPress Version: 7.0.1
PHP Version: 8.3.17
ACF Version: ACF PRO 6.8.6
Browser: Google Chrome v149

Activity

  1. changed the title [-]First custom block added to a post renders fields in (sidebar) instead of main well, before save/refresh[/-] [+]First custom block added to a post renders fields in sidebar instead of main well, before save/refresh[/+] on Jul 15, 2026
  2. johnstonphilip commented on Jul 15, 2026

    @johnstonphilip

    @annafractuous Thanks for the report. This is happening because of a change in WordPress core.

    Are you using a Block theme by any chance? See the section titled Enforced iframed editor in the WordPress 7.1 Roadmap post here:
    https://make.wordpress.org/core/2026/06/19/roadmap-to-7-1/

    The post editor has been moving toward always running inside an iframe, which isolates the editing canvas from the admin’s styles and lets viewport-relative units and media queries work against the canvas instead of the browser window. Today the editor still drops back to a non-iframed mode whenever a block using Block API version 2 or lower is present.

    To make the rollout gradual, the current plan is to enforce iframing for block-based themes in this release, then extend it to all themes in a future release. In both cases, blocks need to be on Block API version 3 to work in the iframed editor, and a migration guide is available to help extenders get there.

    Because Blocks V2 is not compatible with this iframe (which is being enforced by WP core), we recommend upgrading to ACF Blocks v3 to fix this. We have a guide to help with this here:
    https://www.advancedcustomfields.com/resources/acf-blocks-v3/

    ACF Blocks V3 is fully compatible with the new iframe'd approach in WordPress core, though it does change a couple of things about the workflow. Instead of being able to have your ACF fields right in the editor, they will show in a larger pop-out sidebar (called the Expanded Editor), and the block preview will always be used.

  3. annafractuous commented on Jul 21, 2026

    @annafractuous
    Author

    @johnstonphilip thanks for the quick response! We aren't using a Block theme, and we weren't specifying the ACF block version; I believe it was defaulting to V2. From the documentation, it sounds like in V3, fields always appear in the sidebar?

    But in ACF Blocks Version 3, the concept of modes no longer exists. Rather, your block will always be in “preview”, always showing what’s in your PHP render template in the block preview area.
    The block’s ACF fields show up in the sidebar, and also in a pop-out sidebar that has more space.

    I did update our custom ACF blocks to use V3, but we're still seeing some of our fields overflowing their containers in the sidebar. It's only an issue with field groups using a horizontal row layout.

    Image

    We also have some newer blocks created using register_block_type with a block.json, and these display within the main well as expected. Do we need to transition our older blocks to also use the block.json approach?

  4. alberto-marin commented on Jul 23, 2026

    @alberto-marin

    A workaround is to seed every new block-editor post with the Message block.

    Since that block only shows in the editor and never renders on the live site, it's the one that "absorbs" the first-block quirk instead of whatever real content block an editor adds next.

    In practice, this means the "bug" no longer surfaces during normal page-building — the first visible block someone works with is always the second one in the document, which renders correctly.

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions