refactor
This commit is contained in:
@@ -82,8 +82,14 @@ function twentytwentyfour_test1_catalog_markup() {
|
||||
return (string) ob_get_clean();
|
||||
}
|
||||
|
||||
$landing_file = ABSPATH . 'index3.html';
|
||||
$landing_html = file_exists( $landing_file ) ? file_get_contents( $landing_file ) : false;
|
||||
$landing_template = get_theme_file_path( 'template-parts/test1-landing-static.php' );
|
||||
$landing_html = false;
|
||||
|
||||
if ( file_exists( $landing_template ) ) {
|
||||
ob_start();
|
||||
require $landing_template;
|
||||
$landing_html = (string) ob_get_clean();
|
||||
}
|
||||
|
||||
if ( $landing_html ) {
|
||||
$catalog_markup = twentytwentyfour_test1_catalog_markup();
|
||||
@@ -186,7 +192,7 @@ HTML;
|
||||
?>
|
||||
<main class="site-main" role="main">
|
||||
<div style="padding:48px 16px;max-width:1180px;margin:0 auto;">
|
||||
<p>Не удалось загрузить шаблон страницы `index3.html`.</p>
|
||||
<p>Не удалось загрузить шаблон страницы `template-parts/test1-landing-static.php`.</p>
|
||||
</div>
|
||||
</main>
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user