Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.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 第一页显示10篇博客文章,之后显示9篇_Php_Wordpress_Loops - Fatal编程技术网

Php 第一页显示10篇博客文章,之后显示9篇

Php 第一页显示10篇博客文章,之后显示9篇,php,wordpress,loops,Php,Wordpress,Loops,我正在WordPress上使用“骨骼”主题。在我的博客页面上,我试图在3列中显示9篇博客文章,但在第一页上有10篇博客文章,其中第一篇(最近的)被放大到所有3列 在第一页显示10篇文章,然后在第二页显示9篇文章,而不破坏分页的最佳方式是什么 这是我的代码:(我删除了所有的HTML等等,因为我认为它不需要) 我还没有真正尝试过它,因为我没有设置页面功能-但是试试这个 <?php $post = $posts[0]; $c=0; $c++; if( !$paged && $c

我正在WordPress上使用“骨骼”主题。在我的博客页面上,我试图在3列中显示9篇博客文章,但在第一页上有10篇博客文章,其中第一篇(最近的)被放大到所有3列

在第一页显示10篇文章,然后在第二页显示9篇文章,而不破坏分页的最佳方式是什么

这是我的代码:(我删除了所有的HTML等等,因为我认为它不需要)


我还没有真正尝试过它,因为我没有设置页面功能-但是试试这个

<?php 
$post = $posts[0]; $c=0;
$c++; if( !$paged && $c == 1){
$query1 = new WP_Query( array ('posts_per_page' => 1 ) );
if ($query1-> have_posts()) : while ($query1-> have_posts()) : $query1-> the_post(); ?>
<?php the_title(); ?>
<?php endwhile; endif; wp_reset_query();} 
else{
$query2 = new WP_Query( array ('posts_per_page' => 9, 'offset' => 1 ) );
if ($query2-> have_posts()) : while ($query2-> have_posts()) : $query2-> the_post(); ?>
<?php the_title(); ?>
<?php endwhile; endif; wp_reset_query(); }?>

<?php 
$post = $posts[0]; $c=0;
$c++; if( !$paged && $c == 1){
$query1 = new WP_Query( array ('posts_per_page' => 1 ) );
if ($query1-> have_posts()) : while ($query1-> have_posts()) : $query1-> the_post(); ?>
<?php the_title(); ?>
<?php endwhile; endif; wp_reset_query();} 
else{
$query2 = new WP_Query( array ('posts_per_page' => 9, 'offset' => 1 ) );
if ($query2-> have_posts()) : while ($query2-> have_posts()) : $query2-> the_post(); ?>
<?php the_title(); ?>
<?php endwhile; endif; wp_reset_query(); }?>