with this snippet is possible to add a custom block on sidebar on listing page:
add_filter(
'hivepress/v1/templates/listing_view_page',
function( $template ) {
return hivepress()->helper->merge_trees(
$template,
[
'blocks' => [
'page_sidebar' => [
'blocks' => [
'my_custom_content' => [
'type' => 'content',
'content' => 'custom content here',
'_order' => 123,
],
],
],
],
]
);
},
1000
);
But how to add a custom block below the listings category page?
Please try this PHP snippet to add a custom block below the listings
add_filter('hivepress/v1/templates/listings_view_page/blocks', function($blocks, $template){
return hivepress()->helper->merge_trees(
[ 'blocks' => $blocks ],
[
'blocks' => [
'listings_container' => [
'blocks' => [
'custom_category_page_block' => [
'type' => 'content',
'content' => 'Custom contenthere',
'_order' => 1000,
],
]
]
]
]
)['blocks'];
}, 1000, 2);
Hi yevhen, I still can’t add an block with gutenberg below Listing Categories block
Please try this PHP snippet instead
add_filter(
'hivepress/v1/templates/listing_categories_view_page',
function($template){
return hivepress()->helper->merge_trees(
$template,
[
'blocks' => [
'page_content' => [
'blocks' => [
'custom_category_page_block' => [
'type' => 'content',
'content' => 'Custom contenthere',
'_order' => 1000,
],
]
],
],
]
);
},
1000
);
system
Closed
7
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.