| 1 |
<?php |
| 2 |
defined( 'ABSPATH' ) || exit; |
| 3 |
|
| 4 |
if ( wp_is_block_theme() ) { |
| 5 |
?><!DOCTYPE html> |
| 6 |
<html <?php language_attributes(); ?>> |
| 7 |
<head> |
| 8 |
<meta charset="<?php bloginfo( 'charset' ); ?>" /> |
| 9 |
<?php |
| 10 |
wp_head(); |
| 11 |
?> |
| 12 |
</head> |
| 13 |
<body <?php body_class(); ?>> |
| 14 |
<?php |
| 15 |
wp_body_open(); |
| 16 |
} else { |
| 17 |
get_header(); |
| 18 |
} |
| 19 |
$content_post = get_post( $sp_page_builder_id ); |
| 20 |
$content = $content_post->post_content; |
| 21 |
|
| 22 |
echo '<div class="sp-smart-post-page-builder">'; |
| 23 |
|
| 24 |
global $wp_embed; |
| 25 |
$content = $wp_embed->autoembed( $content ); |
| 26 |
$content = do_blocks( $content ); |
| 27 |
$content = do_shortcode( $content ); |
| 28 |
$content = str_replace( ']]>', ']]>', $content ); |
| 29 |
$content = preg_replace( '%<p> \s*</p>%', '', $content ); |
| 30 |
$content = preg_replace( '/^(?:<br\s*\/?>\s*)+/', '', $content ); |
| 31 |
echo $content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 32 |
echo '</div>'; |
| 33 |
|
| 34 |
if ( wp_is_block_theme() ) { |
| 35 |
?> |
| 36 |
</body> |
| 37 |
</html> |
| 38 |
<?php |
| 39 |
wp_head(); |
| 40 |
wp_footer(); |
| 41 |
} else { |
| 42 |
get_footer(); |
| 43 |
} |
| 44 |
|