| 1 |
<?php |
| 2 |
defined( 'ABSPATH' ) || exit; |
| 3 |
|
| 4 |
global $ULTP_HEADER_ID; |
| 5 |
global $ULTP_FOOTER_ID; |
| 6 |
$header = ''; |
| 7 |
|
| 8 |
if ( wp_is_block_theme() && ! $ULTP_HEADER_ID ) { |
| 9 |
ob_start(); |
| 10 |
block_template_part( 'header' ); |
| 11 |
$header = ob_get_clean(); |
| 12 |
} |
| 13 |
|
| 14 |
if ( wp_is_block_theme() ) { |
| 15 |
?><!DOCTYPE html> |
| 16 |
<html <?php language_attributes(); ?>> |
| 17 |
<head> |
| 18 |
<meta charset="<?php bloginfo( 'charset' ); ?>" /> |
| 19 |
<?php wp_head(); ?> |
| 20 |
</head> |
| 21 |
<body <?php body_class(); ?>> |
| 22 |
<?php |
| 23 |
wp_body_open(); |
| 24 |
|
| 25 |
if ( $header ) { |
| 26 |
echo '<header class="wp-block-template-part">' . $header . '</header>'; |
| 27 |
} |
| 28 |
} else { |
| 29 |
get_header(); |
| 30 |
} |
| 31 |
|
| 32 |
do_action( 'ultp_before_content' ); |
| 33 |
|
| 34 |
global $ultp_page_builder_id; |
| 35 |
if ( $ultp_page_builder_id ) { |
| 36 |
$page_id = $ultp_page_builder_id; |
| 37 |
} else { |
| 38 |
$page_id = ultimate_post()->builder_check_conditions( 'return_p' ); |
| 39 |
} |
| 40 |
|
| 41 |
$width = $page_id ? ( get_post_meta( $page_id, '__container_width', true ) ? get_post_meta( $page_id, '__container_width', true ) : '1140' ) : '1140'; |
| 42 |
$sidebar = $page_id ? get_post_meta( $page_id, '__builder_sidebar', true ) : ''; |
| 43 |
$widget_area = $page_id ? get_post_meta( $page_id, '__builder_widget_area', true ) : ''; |
| 44 |
$has_widget = ( $sidebar && $widget_area != '' ) ? true : false; |
| 45 |
|
| 46 |
echo '<div class="ultp-builder-container' . ( esc_html( $has_widget ? ' ultp-widget-' . $sidebar : '' ) ) . ( esc_html( ' ultp-builderid-' . $page_id ) ) . '" style="margin:0 auto; width: -webkit-fill-available; width: -moz-available; max-width: ' . esc_html( $width ) . 'px;">'; |
| 47 |
if ( $has_widget && $sidebar == 'left' ) { |
| 48 |
echo '<div class="ultp-sidebar-left">'; |
| 49 |
if ( is_active_sidebar( $widget_area ) ) { |
| 50 |
dynamic_sidebar( $widget_area ); |
| 51 |
} |
| 52 |
echo '</div>'; |
| 53 |
} |
| 54 |
echo '<div class="ultp-builder-wrap">'; |
| 55 |
if ( $page_id ) { |
| 56 |
/* Content Filtering for elementor & divi */ |
| 57 |
$builder_type = ''; |
| 58 |
$body_class = get_body_class(); |
| 59 |
$divi_settings = ultimate_post()->get_setting( 'ultp_divi' ); |
| 60 |
$elem_settings = ultimate_post()->get_setting( 'ultp_elementor' ); |
| 61 |
if ( $divi_settings == 'true' && class_exists( 'ET_Builder_Module' ) && in_array( 'et-fb', $body_class ) ) { |
| 62 |
$builder_type = 'divi'; |
| 63 |
} elseif ( did_action( 'elementor/loaded' ) && $elem_settings == 'true' && in_array( 'elementor-editor-active', $body_class ) && in_array( 'elementor-editor-wp-post', $body_class ) ) { |
| 64 |
$builder_type = 'elementor'; |
| 65 |
} |
| 66 |
/* Content Filtering for elementor & divi */ |
| 67 |
ultimate_post()->get_post_content( $page_id, $builder_type ); |
| 68 |
} else { |
| 69 |
the_content(); |
| 70 |
} |
| 71 |
echo '</div>'; |
| 72 |
if ( $has_widget && $sidebar == 'right' ) { |
| 73 |
echo '<div class="ultp-sidebar-right">'; |
| 74 |
if ( is_active_sidebar( $widget_area ) ) { |
| 75 |
dynamic_sidebar( $widget_area ); |
| 76 |
} |
| 77 |
echo '</div>'; |
| 78 |
} |
| 79 |
echo '</div>'; |
| 80 |
|
| 81 |
do_action( 'ultp_after_content' ); |
| 82 |
|
| 83 |
|
| 84 |
if ( wp_is_block_theme() ) { |
| 85 |
?> |
| 86 |
</body> |
| 87 |
</html> |
| 88 |
<?php |
| 89 |
if ( ! $ULTP_FOOTER_ID ) { |
| 90 |
ob_start(); |
| 91 |
block_template_part( 'footer' ); |
| 92 |
$footer = ob_get_clean(); |
| 93 |
echo '<footer class="wp-block-template-part">' . $footer . '</footer>'; |
| 94 |
} |
| 95 |
// wp_head(); |
| 96 |
// wp_head(); all ready wp head declared in header, i can not find any conflict to check that, if you find any conflict for removing then use it |
| 97 |
wp_footer(); |
| 98 |
} else { |
| 99 |
get_footer(); |
| 100 |
} |
| 101 |
|