Skip to content

Instantly share code, notes, and snippets.

@hivepress
Created July 23, 2022 23:16
Show Gist options
  • Save hivepress/daa673af80bd3bbde0dadd8fe5263282 to your computer and use it in GitHub Desktop.
Save hivepress/daa673af80bd3bbde0dadd8fe5263282 to your computer and use it in GitHub Desktop.
Add custom HTML wrapper to HivePress pages #hivepress #themes
<?php
add_filter(
'hivepress/v1/blocks/page',
function( $args ) {
return hivepress()->helper->merge_arrays(
$args,
[
'blocks' => [
'before' => [
'type' => 'content',
'content' => '<div class="my-custom-wrapper">',
'_order' => 1,
],
'after' => [
'type' => 'content',
'content' => '</div>',
'_order' => 1000,
],
],
]
);
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment