Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/229.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/1/wordpress/12.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/0/assembly/6.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
Php 每张幻灯片、非幻灯片、Wordpress各获得2篇文章_Php_Wordpress_Loops_Categories_Posts - Fatal编程技术网

Php 每张幻灯片、非幻灯片、Wordpress各获得2篇文章

Php 每张幻灯片、非幻灯片、Wordpress各获得2篇文章,php,wordpress,loops,categories,posts,Php,Wordpress,Loops,Categories,Posts,我正试图在我的Wordpress主题中每一张幻灯片上获得两篇文章。我从类别“新闻”中获得帖子,并希望显示大约5页2篇帖子。此时,它只显示一个 这是我目前掌握的密码 <div class="banner"> <ul> <?php $logo = new WP_Query( array( 'category_name' => 'news', 'posts_per_page' => 10 )

我正试图在我的Wordpress主题中每一张幻灯片上获得两篇文章。我从类别“新闻”中获得帖子,并希望显示大约5页2篇帖子。此时,它只显示一个

这是我目前掌握的密码

<div class="banner">
                <ul>
                <?php   $logo = new WP_Query( array( 'category_name' => 'news', 'posts_per_page' => 10 ) ); ?>
                <?php   while ($logo->have_posts()) : $logo->the_post(); ?>
                <?php   $do_not_duplicate[] = $post->ID; ?>

                    <li class="news-item col-1-1 no-pad">

                        <div class="description">
                            <a href="<?php echo get_permalink(); ?>"><h4><?php the_title(); ?></h4></a>
                            <p class="post-date">Gepubliceerd op: <?php echo get_the_date('d-m-Y'); ?></p>
                            <p><?php content(160); ?></p>
                        </div>

                        <a class="button-med" href="<?php echo get_permalink(); ?>">Lees meer</a>

                    </li>

                <?php   endwhile; wp_reset_postdata(); ?>
                </ul>
            </div>

  • Gepubliceerd op: