| 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 |
| 23 |
wp_body_open(); |
| 24 |
|
| 25 |
if ( ! $has_header ) { |
| 26 |
ob_start(); |
| 27 |
block_template_part( 'header' ); |
| 28 |
$header = ob_get_clean(); |
| 29 |
echo '<header class="wp-block-template-part">' . $header . '</header>'; |
| 30 |
} |
| 31 |
} else { |
| 32 |
get_header(); |
| 33 |
} |
| 34 |
|
| 35 |
do_action( 'ultp_before_content' ); |
| 36 |
|
| 37 |
$width = ultimate_post()->get_setting( 'container_width' ); |
| 38 |
$width = $width ? $width : '1140'; |
| 39 |
?> |
| 40 |
<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;"> |
| 41 |
<?php |
| 42 |
while ( have_posts() ) : |
| 43 |
the_post(); |
| 44 |
the_content(); |
| 45 |
if ( comments_open() || get_comments_number() ) { |
| 46 |
comments_template(); |
| 47 |
} |
| 48 |
endwhile; |
| 49 |
?> |
| 50 |
</div> |
| 51 |
|
| 52 |
<?php |
| 53 |
do_action( 'ultp_after_content' ); |
| 54 |
if ( $is_block_theme ) { |
| 55 |
?> |
| 56 |
</body> |
| 57 |
</html> |
| 58 |
<?php |
| 59 |
if ( ! $has_footer ) { |
| 60 |
ob_start(); |
| 61 |
block_template_part( 'footer' ); |
| 62 |
$footer = ob_get_clean(); |
| 63 |
echo '<footer class="wp-block-template-part">' . $footer . '</footer>'; |
| 64 |
} |
| 65 |
wp_head(); |
| 66 |
wp_footer(); |
| 67 |
} else { |
| 68 |
get_footer(); |
| 69 |
} |
| 70 |
|