I’m utilizing the loop in my customized web page template as you may see in my code. Solely 2 posts should be proven and for the remainder I ought to be capable to have pagination.
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts(
array (
'posts_per_page' => 2,
'post_type' => 'submit',
'category_name' => 'information',
'class' => 1,
'paged' => $paged )
);
// The Loop
whereas ( have_posts() ) : the_post();?>
<div class="news-page-content-wrapper">
<div class="news-page-content">
<h1><a category="read-more"href="<?php the_permalink(); ?>"><?php the_title();?></a></h1>
<determine><?php the_post_thumbnail(); ?></determine>
<p><?php echo get_the_excerpt();?></p>
<a href="<?php the_permalink(); ?>">Learn Extra»</a>
</div>
</div>
<?endwhile;
// Reset Question
wp_reset_query();
?>
<?php next_posts_link(); ?>
<?php previous_posts_link(); ?>
How can I’ve pagination utilizing the loop with class ID?