Answer the question
In order to leave comments, you need to log in
Why does the_content() return the content of the page and not the post?
Hello, there are several blocks on the page. Did it like this:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="col-md-4 col-sm-4 col-xs-6 howWeDo__innerItem">
<div class="howWeDo__item">
<div class="howWeDo__header"><img src="<?php bloginfo('template_directory'); ?>/img/icons/howWeDo_1.png" alt="" class="howWeDo__img"></div>
<div class="howWeDo__footer"><?php the_post(); ?></div>
</div>
</div>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
Answer the question
In order to leave comments, you need to log in
Hello.
And so?
<?php
global $post;
$post = get_post('ID_ЗАПИСИ');
if($post) :
setup_postdata($post);
?>
<div class="col-md-4 col-sm-4 col-xs-6 howWeDo__innerItem">
<div class="howWeDo__item">
<div class="howWeDo__header"><img src="<?php bloginfo('template_directory'); ?>/img/icons/howWeDo_1.png" alt="" class="howWeDo__img"></div>
<div class="howWeDo__footer"><?php the_content(); ?></div>
</div>
</div>
<?php wp_reset_query(); endif; ?>
In theory, the POST block should be between the beginning of the if condition and its end, endif. For some reason, your condition includes a block column with Bootstrap classes:
Try like this:
<div class="col-md-4 col-sm-4 col-xs-6 howWeDo__innerItem">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="howWeDo__item">
<div class="howWeDo__header"><img src="<?php bloginfo('template_directory'); ?>/img/icons/howWeDo_1.png" alt="" class="howWeDo__img"></div>
<div class="howWeDo__footer"><?php the_post(); ?></div>
</div>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question