表中的Wordpress循环不会添加超过三行

时间:2016-07-20 12:00:57

标签: php wordpress

我正在my website开发一个议程页面,它应该在行未来事件中列出。问题是,循环只显示三行,即使在'showposts'循环参数中它设置为10。

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

                <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; ?>

1 个答案:

答案 0 :(得分:0)

检查设置 - &gt;阅读并查看设置显示的帖子数量。如果您安装了缓存插件,请清除缓存

相关问题