| 1 |
<?php |
| 2 |
defined( 'ABSPATH' ) || exit; |
| 3 |
|
| 4 |
$is_block_theme = wp_is_block_theme(); |
| 5 |
|
| 6 |
global $ULTP_HEADER_ID; |
| 7 |
global $ULTP_FOOTER_ID; |
| 8 |
$builder_active = ultimate_post()->get_setting('ultp_builder') != 'false'; |
| 9 |
$has_header = $builder_active ? $ULTP_HEADER_ID : ''; |
| 10 |
$has_footer = $builder_active ? $ULTP_FOOTER_ID : ''; |
| 11 |
|
| 12 |
if( $is_block_theme ) { |
| 13 |
?><!DOCTYPE html> |
| 14 |
<html <?php language_attributes(); ?>> |
| 15 |
<head> |
| 16 |
<meta charset="<?php bloginfo( 'charset' ); ?>" /> |
| 17 |
<?php |
| 18 |
wp_head(); |
| 19 |
?> |
| 20 |
</head> |
| 21 |
<body <?php body_class(); ?>> |
| 22 |
<?php wp_body_open(); |
| 23 |
|
| 24 |
if( !$has_header ) { |
| 25 |
ob_start(); |
| 26 |
block_template_part('header'); |
| 27 |
$header = ob_get_clean(); |
| 28 |
echo '<header class="wp-block-template-part">'.$header.'</header>'; |
| 29 |
} |
| 30 |
} else { |
| 31 |
get_header(); |
| 32 |
} |
| 33 |
|
| 34 |
do_action( 'ultp_before_content' ); |
| 35 |
|
| 36 |
$width = ultimate_post()->get_setting( 'container_width' ); |
| 37 |
$width = $width ? $width : '1140'; |
| 38 |
?> |
| 39 |
<div class="ultp-template-container" style="margin:0 auto;max-width:<?php echo esc_attr( $width ); ?>px; padding: 0 15px; width: -webkit-fill-available; width: -moz-available;"> |
| 40 |
<?php |
| 41 |
while ( have_posts() ) : the_post(); |
| 42 |
the_content(); |
| 43 |
if ( comments_open() || get_comments_number() ) { |
| 44 |
comments_template(); |
| 45 |
} |
| 46 |
endwhile; |
| 47 |
?> |
| 48 |
</div> |
| 49 |
|
| 50 |
<?php |
| 51 |
do_action( 'ultp_after_content' ); |
| 52 |
if( $is_block_theme ) { |
| 53 |
?> |
| 54 |
</body> |
| 55 |
</html> |
| 56 |
<?php |
| 57 |
if ( !$has_footer ) { |
| 58 |
ob_start(); |
| 59 |
block_template_part('footer'); |
| 60 |
$footer = ob_get_clean(); |
| 61 |
echo '<footer class="wp-block-template-part">'.$footer.'</footer>'; |
| 62 |
} |
| 63 |
wp_head(); |
| 64 |
wp_footer(); |
| 65 |
} else { |
| 66 |
get_footer(); |
| 67 |
} |