Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/multithreading/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在我的single.php WordPress博客中循环只返回一篇文章_Php_Loops_Return_Sidebar - Fatal编程技术网

在我的single.php WordPress博客中循环只返回一篇文章

在我的single.php WordPress博客中循环只返回一篇文章,php,loops,return,sidebar,Php,Loops,Return,Sidebar,嗨,我有一个wordpress博客,我把下面的代码放在侧栏的single.php页面中 代码与hompage侧栏中的代码相同> 此代码在hompage侧栏中正确运行,并返回到所有帖子 但是在single.php侧边栏中,只返回一篇文章 <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="new-posts-form"> <div cl

嗨,我有一个wordpress博客,我把下面的代码放在侧栏的single.php页面中 代码与hompage侧栏中的代码相同> 此代码在hompage侧栏中正确运行,并返回到所有帖子 但是在single.php侧边栏中,只返回一篇文章

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

<div class="new-posts-form">
<div class="new-posts-img"><a href="<?php the_permalink(); ?>"></a><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_post_thumbnail(array(100,80)); ?></a></div>
<div class="new-posts-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
 <div class="new-post-description"><?php content('11'); ?></div>
 <div class="new-post-add-date-time"><img src="<?php bloginfo('template_url'); ?>/images/tb_clock.png" /><?php the_time('F j, Y'); ?> at <?php the_time('g:i a'); ?> : <?php the_category(', ') ?></div>


<?php endwhile; ?>
<?php endif; ?>

/图像/tb_clock.png“/>位于:

我认为在single.php页面上,您应该使用这个

参考请查收

我正在努力解决你的问题,希望这对你有所帮助

谢谢
anand

single.php
中的
single
应该会给你一个提示,为什么…:)