@yadscreech

Не отображается текст в записях WordPress?

Есть шаблон с сайта underscores начал натягивать верску, всё нормально было, потом в один из моментов просто пропал текст записей, с чем связанно не знаю, подумал что поставил какой-то кривой плагин, удалил их - не помогло, переустановил WP сначала тоже все ок, но потом опять пропал текст на странице, попробовал стандартные темы - всё появляется выводится, ну я закинул страницы single.php и content.php из стандартных тем в мой шаблон - все равно, с чем связанно не знаю, знаю что single.php работает, а вот content.php выплёвывать текст не хочет почему-то, кто шарит подскажите или направьте где можно узнать

Еще вопрос, хостинг мог повлиять на это?

Шаблон поста
<?php
/*
Template Name: Пост с формой (Будущий директор)
Template Post Type: post
*/
get_header();
?>
    </header>

    <style>
        #top,
        #footer {
            display: none
        }
    </style>
    <!-- post-form.php -->
	<section class="post" id="post--form">	
		<div class="container">        

			<?php
			while ( have_posts() ) :
			the_post();

			get_template_part( 'template-parts/content-post', get_post_type() );

			the_post_navigation();


			endwhile; // End of the loop.
            ?>
            
            <?php echo do_shortcode( '[contact-form-7 id="58" title="Форма на страницах курсов"]' ); ?> 
            
            <div class="addention--text">
                <span>Мы перезвоним Вам в течении дня для подтверждени заявки</span>
                <span>Есть вопросы? Нажмите <a href="https://schooltourismspb.ru/есть-вопросы/">сюда</a>.</span>
            </div>

		</div><!-- container -->
	</section><!-- post -->
<?php
get_footer();


content-post на который ссылается шаблон записи
<?php
/**
 * Template part for displaying posts
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package School_of_Tourism
 */

?>
<!-- content-post -->
<article id="post-<?php the_ID(); ?> content--post__article" <?php post_class(); ?>>
	<header class="entry-header" id="content--post__header">
            <div class="title--wrapper">
                <a class="home__link" href="https://schooltourismspb.ru">
                    <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
                        <path class="st0" d="M25,3c12.2,0,22,9.9,22,22s-9.9,22-22,22S3,37.2,3,25S12.9,3,25,3 M25,2C12.3,2,2,12.3,2,25s10.3,23,23,23
                                s23-10.3,23-23S37.8,2,25,2L25,2z"></path>
                        <polygon class="st0" points="19.4,23.9 25,20.2 20.2,20.2 12.6,25 20.1,29.8 25,29.8 18.8,26.1 36.4,26.1 36.4,24.1 "></polygon>
                    </svg>
                </a>
		<?php
		if ( is_singular() ) :
            the_title( '<h1 class="entry-title">', '</h1>' );
            ?>
                <div class="block-7537" style="height: 64px; width: 64px"></div>
            </div>
            <!-- title--wrapper -->
            <div class="post--wrapper">                
                <div class="post--buttons">
                    <a href="/запись-на-курс/" class="post--buttons__record">Записаться</a>
                    <button class="post--buttons__price"><?php echo get_post_meta($post->ID, 'price', true); ?></button>
                </div>
            </div>
            <!-- post--wrapper -->
            <?php
		else :
			the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
		endif;
?>
	</header><!-- .entry-header -->	

	<div class="entry-content">

		<?php the_content( sprintf(
			wp_kses(
				/* translators: %s: Name of current post. Only visible to screen readers */
				__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'school_of_tourism' ),
				array(
					'span' => array(
						'class' => array(),
					),
				)
			),
			get_the_title()
		) );

		

		wp_link_pages( array(
			'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'school_of_tourism' ),
			'after'  => '</div>',
		) );
		?>
	</div><!-- .entry-content -->
	
</article><!-- #post-<?php the_ID(); ?> -->
  • Вопрос задан
  • 605 просмотров
Решения вопроса 1
@yadscreech Автор вопроса
Все просто, в header был такой код
<?php echo get_post_meta($post->ID, 'insta', true); ?>

Он выводил произвольные поля из поста, и видимо не нашел пост или это поле и из-за этого все ломалось
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы