Why is adding a block after the page descripton not working?


add_filter(
	'hivepress/v1/extensions',
	function( $extensions ) {
		$extensions[] = __DIR__;
		return $extensions;
	}
);

add_filter(
    'hivepress/v1/templates/listing_view_page/blocks',
    function( $blocks, $template ) {
        $blocks['page_container']['blocks']['page_columns']['blocks']['page_content']['blocks']['page_insights'] = [
            'type'   => 'part',
            'path'   => 'listing/view/page/page-views',
            '_label' => 'Page Insights',
            '_order' => 71,
        ];

        return $blocks;
    },
    11,
    2
);
if i change
$blocks['page_container']['blocks']['page_columns']['blocks']['page_content']['blocks']['page_insights']

to

$blocks['page_container']['blocks']['page_columns']['blocks']['page_content']['blocks']['listing_description']

the listing description gets cleared, but why is this not adding new blocks? This is in a custom pluigin and the relative path for the part is correct.

Hi,

We recommend using hivepress()->template->merge_blocks(). You can see examples here:

I hope it helps