Created
July 23, 2022 23:16
-
-
Save hivepress/daa673af80bd3bbde0dadd8fe5263282 to your computer and use it in GitHub Desktop.
Add custom HTML wrapper to HivePress pages #hivepress #themes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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