Я пытаюсь создать пользовательский шаблон страницы, но код в файле page.php в используемой теме - это не то, что я испытывал раньше.
TL; DR: есть имя для этого типа кода / кодирования?
Я обычно могу просто добавить HTML в теле php-файла, но здесь все зациклено (?), И я не уверен, как добавить какой-либо HTML.
Поскольку я не знаю, что с Google, я не знаю, как это выяснить или с чего начать.
Вот код из файла page.php:
<?php /* Template Name: Custom Template Name */
get_header();
list($masters_layout) = theme_page_layout_scheme();
echo '<!--_____ Start Content ____ -->' . "\n";
if ($masters_layout == 'r_sidebar') {
echo '<div class="content entry" >' . "\n\t";
} elseif ($masters_layout == 'l_sidebar') {
echo '<div class="content entry fr" >' . "\n\t";
} else {
echo '<div class="middle_content entry" >';
}
if (have_posts()) : the_post();
$content_start = substr(get_post_field('post_content', get_the_ID()), 0, 15);
if ($masters_layout == 'fullwidth' && $content_start === '[masters_row') {
echo '</div>' .
'</div>';
}
the_content();
echo '<div class="cl"></div>';
if ($masters_layout == 'fullwidth' && $content_start === '[masters_row') {
echo '<div class="content_wrap ' . $masters_layout .
((is_singular('project')) ? ' project_page' : '') .
((is_singular('profile')) ? ' profile_page' : '') .
'">' . "\n\n" .
'<div class="middle_content entry" >';
}
wp_link_pages(array(
'before' => '<div class="subpage_nav" >' . '<strong>' . esc_html__('Pages', 'themename') . ':</strong>',
'after' => '</div>' . "\n",
'link_before' => ' [ ',
'link_after' => ' ] '
));
comments_template();
endif;
echo '</div>' . "\n" .
'<!-- _____ Finish Content _____ -->' . "\n\n";
get_footer();
Я привык видеть закрытые теги (?) И HTML, добавленные туда. Например:
<?php /* Template Name: Custom Template Name */ ?>
<?php get_header(); ?>
<!-- start content container -->
<div class="container">
<div class="row dmbs-content">
<?php //left sidebar ?>
<div class="main-content">
<?php // theloop
if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<h2 class="page-header"><?php the_title() ;?></h2>
<?php the_content(); ?>
<?php wp_link_pages(); ?>
<?php comments_template(); ?>
<?php endwhile; ?>
<?php else: ?>
<?php get_404_template(); ?>
<?php endif; ?>
</div>
<?php //get the right sidebar ?>
</div>
</div>
<!-- end content container -->
<?php get_footer(); ?>
Любая помощь приветствуется!