I want to be able to add a block to the bottom of my listing description so I can add an ad there and be able to change it regularly. any help much appreciated
mark
I want to be able to add a block to the bottom of my listing description so I can add an ad there and be able to change it regularly. any help much appreciated
mark
Hi,
You can rebuild the listing layout using a custom template in HivePress > Templates. This would give you full flexibility to arrange the page however you like and include any blocks, even those added by an ad plugin.
If you prefer to insert something in a specific location rather than redesign the entire template, then a custom code snippet targeting the listing_view_page template would be required. If you’re familiar with coding, you can take a look at this code snippet to have a better understanding how to add the content to listing page: Assistance Needed to Edit Listing Page and Add Video Embed Field - #13 by ihor
Hope I helped with your request.
Thanks Kseniia,
it seems to be able to do something simple like being able to add an ad block or something else to appear on every listing I have to rebuild a whole template which I don’t want to do/or have the ability to do (that’s why I am using hive press)
adding it to each listing isn’t an option for me as I’ll shortly have 100+ listings
seems like ii’m stuck unfortunately
Overriding the entire template is only one of the two options.
The second option does require a custom code snippet, but here’s a sample to get you started.
add_filter(
'hivepress/v1/templates/listing_view_page',
function( $template ) {
return hivepress()->template->merge_blocks(
$template,
[
'page_content' => [
'blocks' => [
'custom_button' => [
'type' => 'content',
'content' => 'custom content here',
'_order' => 1000,
],
],
],
]
);
}
);
If you already have custom HTML for the advertisement, you can simply insert it there instead of plain text.
Hope this helps.