2016-07-20 19 views
0

我正在开发一个关于my website的议程页面,应该将其列入行未来事件中。问题是,循环只显示三行,即使在'showposts'循环参数它设置为10.表中的Wordpress循环不会添加超过三行

我注意到当检查页面代码,它实际上循环其他帖子,但他们'显示:无'显示 - 我不知道为什么。这是我的代码:

   <table class="agenda-table" align="center" cellspacing="10"> 
        <tr> 
         <th> Quando </th> 
         <th style="background: #f0f0f0"> </th> 
         <th> Quem </th> 
         <th style="background: #f0f0f0"> </th> 
         <th> Onde </th> 
         <th style="background: #f0f0f0"> </th> 
         <th> O quê </th> 
        </tr> 
        <?php 
         query_posts('cat=7&showposts=10'); 
         if (have_posts()) : while(have_posts()) : the_post(); 
         $dia = get_post_custom_values('dia'); 
         $quem = get_post_custom_values('quem'); 
         $link = get_post_custom_values('link'); 
        ?> 
        <tr> 
         <td> <a target="_blank" href="<?php echo $link[0];?>"><?php echo $dia[0]; ?> </a> </td> 
         <td> </td> 
         <td> <a target="_blank" href="<?php echo $link[0];?>"><?php echo $quem[0];?> </a></td> 
         <td> </td> 
         <td> <a target="_blank" href="<?php echo $link[0];?>"><?php echo get_the_content();?> </a> </td> 
         <td> </td> 
         <td> <a target="_blank" href="<?php echo $link[0];?>"> <?php echo get_the_title();?> </a></td> 
        </tr> 

       <?php endwhile; endif; ?> 

回答

0

检查设置 - >阅读,看看有多少帖子被设置显示。如果你安装了缓存插件,请清除缓存

+0

它也设置了10个帖子,我没有安装任何缓存插件:s – user3088010

+0

所以尝试通过查询获取$ args = array('post_type'=>'后”, '猫'=> 7); $ loop = new WP_Query($ args); ($ loop-> have_posts()):$ loop-> the_post(); //做某事 end; –

+0

做到了这一点,它输出相同的错误。它实际上是在循环其他帖子,但它们在DOM – user3088010