Answer the question
In order to leave comments, you need to log in
Add No Posts to Wordpress Ready Loop?
I'm trying to fix the post output code in one plugin:
<?php foreach($posts as $postdata){ ?>
<?php foreach($postdata as $post){ setup_postdata($post); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class('post'); ?>>
Здесь отображение самого поста
</div><!-- /.post -->
<?php } ?>
<?php } ?>
Answer the question
In order to leave comments, you need to log in
I don't know what's in the variables, but probably something like this:
<?php if($posts) : ?>
<?php foreach($posts as $postdata){ ?>
<?php foreach($postdata as $post){ setup_postdata($post); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class('post'); ?>>
Здесь отображение самого поста
</div><!-- /.post -->
<?php } ?>
<?php } ?>
<?php else : ?>
<div>Нет записей</div>
<?php endif; ?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question