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.
andrii
April 29, 2025, 8:38am
4
Hi,
We recommend using hivepress()->template->merge_blocks(). You can see examples here:
Hi,
Please try this code snippet if you want to add a custom title and description to the Listings page, excluding the category and search pages:
add_filter(
'hivepress/v1/templates/listings_view_page/blocks',
function ( $blocks ) {
if ( is_page() ) {
$blocks = hivepress()->template->merge_blocks(
$blocks,
array(
'page_content' => array(
'blocks' => array(
'heading' => array(
'type' => 'content',
'content' => '<h1>Test</h1><p>Test</p>',
…
Hi,
Please try this PHP snippet:
add_filter(
'hivepress/v1/templates/user_account_page',
function($template){
$menu = hivepress()->template->fetch_block($template, 'user_account_menu');
return hivepress()->template->merge_blocks(
$template,
[
'page_sidebar' => [
'blocks' => [
'custom_menu_block' => [
'type' => 'container',
'_order' => 10,
'attributes' => [
'class' => [ 'hp-widget', 'widget', 'widget--sidebar', 'widget_nav_menu' ],…
I hope it helps
system
Closed
May 29, 2025, 8:39am
5
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.