Thanks for your feedback, we’ll add a hook or another solution for this. If adding a custom CSS class to the existing wrapper is enough please try using this code snippet:
add_filter(
'hivepress/v1/blocks/page',
function( $args ) {
return hivepress()->helper->merge_arrays(
$args,
[
'attributes' => [
'class' => [ 'class-one', 'class-two' ],
],
]
);
}
);
Hi,
Thanks for the reply!
The problem is that we include hooks in the default template files. This is what our page.php template file looks like for example: https://a.cl.ly/nOuRv2JN – so while we could insert classes to fix any potential layout issues, we can’t add default hooks so if anyone is inserting content to their site via one of their hooks it won’t display on the HivePress pages.
If there was a before/after content hooks we could provide full integration on the theme side.
Plus, it would allow people to insert extra content on their HivePress pages before/after the content if they wanted (such as advertisements for example) so it could be helpful not just for theme developers.
Thank you!!
Thanks for the details, indeed there’s no easy way to insert custom HTML between the header/footer and the HivePress page wrapper, we’ll try to resolve this in the next update.
While testing I found out that it’s already possible with existing hooks, by inserting new blocks before and after the page blocks. Please try this snippet to add a custom class and custom content before/after the HivePress page content:
add_filter(
'hivepress/v1/blocks/page',
function( $args ) {
return hivepress()->helper->merge_arrays(
$args,
[
'attributes' => [
'class' => [ 'custom-class' ],
],
'blocks' => [
'before' => [
'type' => 'content',
'content' => 'custom HTML before',
'_order' => 1,
],
'after' => [
'type' => 'content',
'content' => 'custom HTML after',
'_order' => 1000,
],
],
]
);
}
);
We’ll also add a new article to the docs with the most common theme integration issues.