How can I make a category template for one specific category in the default HivePress theme? I want to apply some shortcodes but to only one category overview page (given the category ID).
It’s possible, but this would require code customizations, e.g. a code snippet for the hivepress/v1/templates/listings_view_page
hook, where you can check specific conditions and insert new blocks if the current page is a category.
Please try this PHP snippet to start but please that it can require further customization. If you are not familiar with the code customization then please consider hiring someone for custom work https://fvrr.co/32e7LvY
add_filter(
'hivepress/v1/templates/listings_view_page',
function( $template ) {
if(is_tax('hp_listing_category')){
$template = hivepress()->template->merge_blocks(
$template,
[
'page_columns' => [
'blocks' => [
'custom_shortcode_before_content' => [
'type' => 'content',
'content' => do_shortcode('[any_shortcode_here]'),
'_order' => 15,
],
'custom_shortcode_after_content' => [
'type' => 'content',
'content' => do_shortcode('[any_shortcode_here]'),
'_order' => 25,
],
]
]
]
);
}
return $template;
},
1000
);