Question regarding index posts and pagination
-
Hello there! I’ve a site running the last version of WordPress 4.4 and want to make a modification regarding the number of post displayed on index.php than pagination.
The problem is that the index.php page must show 7 posts and the pages of pagination (/page/2 – /page/3 – /page/4) must show 8 posts. I’m trying to do this modification but can’t get it to work.
Also the first post on the index.php page must have a different style but not on the paginated version. My actual code is:
<?php if (have_posts()) : ?> <?php $post = $posts[0]; $c=0; ?> <?php query_posts($query_string . '&cat=1,2'); ?> <?php /* Start the Loop */ ?> <?php while (have_posts()) : the_post(); ?> <?php $c++; if( $c == 1) :?> STYLE FIRST POST <?php else :?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endif;?> <?php endwhile; ?>Thanks very much in advance! =D
The topic ‘Question regarding index posts and pagination’ is closed to new replies.