Commit realizado el 12:13:52 08-04-2024
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
<!DOCTYPE html>
|
||||
<html <?php language_attributes(); ?> style="margin-top: 0 !important;">
|
||||
<head>
|
||||
<meta charset="<?php bloginfo( 'charset' ); ?>"/>
|
||||
<?php
|
||||
show_admin_bar( false );
|
||||
|
||||
/**
|
||||
* Fires in the head, before {@see wp_head()} is called. This action can be used to
|
||||
* insert elements into the beginning of the head before any styles or scripts.
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
do_action( 'et_head_meta' );
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
document.documentElement.className = 'js';
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.et-cloud-item-editor.et-bp-settings-hide-settings-modal .et-fb-modal {
|
||||
z-index: -1 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<?php wp_head(); ?>
|
||||
</head>
|
||||
<?php
|
||||
/**
|
||||
* body's overflow:hidden is necessary to avoid unwanted scrollbar during layout preview loading
|
||||
* Nothing else (inline style added by js, on-page css) is faster enough to prevent it.
|
||||
*/
|
||||
?>
|
||||
<body <?php body_class(); ?> style="overflow: hidden;">
|
||||
<div id="page-container">
|
||||
<?php
|
||||
// Get TB template for current layout block preview page (basically FE of current page);
|
||||
// Use TB if there is applicable template or default layout if it doesn't exist
|
||||
$tb_template = ET_GB_Block_Layout::get_preview_tb_template();
|
||||
|
||||
if ( $tb_template['has_layout'] ) {
|
||||
$layout_id = $tb_template['layout_id'];
|
||||
$layout_enabled = $tb_template['layout_enabled'];
|
||||
$template_id = $tb_template['template_id'];
|
||||
|
||||
et_theme_builder_frontend_render_body( $layout_id, $layout_enabled, $template_id );
|
||||
} else {
|
||||
?>
|
||||
<div id="main-content">
|
||||
<?php
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
?>
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<div class="entry-content">
|
||||
<?php the_content(); ?>
|
||||
</div>
|
||||
</article>
|
||||
<?php endwhile; ?>
|
||||
</div><!-- #main-content -->
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div><!-- #page-container -->
|
||||
<div id="block-layout-preview-footer">
|
||||
<?php wp_footer(); ?>
|
||||
</div><!-- #block-layout-preview-footer -->
|
||||
</body>
|
||||
</html>
|
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* Modified block template canvas file to render Visual and Theme Builder layouts.
|
||||
*
|
||||
* @since 4.9.8
|
||||
* @since 4.14.7 Remove block template HTML to only display TB Template.
|
||||
*
|
||||
* This block template canvas should be used only when TB Template (Header/Footer/Body)
|
||||
* is active on current page. Otherwise, we have to use default Block Editor template.
|
||||
*
|
||||
* @see {ET_Builder_Block_Templates::get_custom_query_template}
|
||||
*
|
||||
* @package Divi
|
||||
*/
|
||||
|
||||
get_header();
|
||||
|
||||
if ( is_singular() && have_posts() ) {
|
||||
// If current page is singular, render the content normally.
|
||||
// Template type: frontpage, home (page), page, paged, privacypolicy, single, singular.
|
||||
while ( have_posts() ) {
|
||||
the_post();
|
||||
the_content();
|
||||
}
|
||||
} else {
|
||||
/**
|
||||
* Fires the main content on block template canvas.
|
||||
*
|
||||
* Use this hook to display custom output for non singular page.
|
||||
*
|
||||
* @since 4.14.7
|
||||
*
|
||||
* Template type: 404, archive, author, category, date, home (non-page), index, search, tag, taxonomy.
|
||||
*/
|
||||
do_action( 'et_block_template_canvas_main_content' );
|
||||
}
|
||||
|
||||
get_footer();
|
Reference in New Issue
Block a user