Pagination not working Category Page
-
My site is auto generating some code for older/newer posts on the category page, but when you click “older” the link does not work. it is generating /blog/page/2 from /blog/
here is my code:<?php get_header(); ?> <!-- Main --> <article id="main"> <?php $args = array ( 'category' => 1, 'posts_per_page' => 10); $myposts = get_posts( $args ); foreach( $myposts as $post ) : setup_postdata($post); ?> <section class="wrapper style4 container"> <div class="content"> <section> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="row"> <div class="5u"> <A href="<?php the_permalink() ?>" class="noborder"><?php if ( has_post_thumbnail() ) { the_post_thumbnail('thumbnail'); } ?></a></div> <div class="7u"> <header> <h1 class="entry-title blog"><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?> "rel="bookmark"><?php the_title(); ?></a> </header> <section class="entry-content"> <?php $content = get_the_content(); $content = strip_tags($content); echo substr($content, 0, 250); ?>... <ul class="buttons"><li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>" class="button">Full Post</a></li></ul> </div> </section> </div> </div></article> </section></div></section> <?php endforeach; ?> </article> <div class="content"> <div class="row"> <nav> <div class="6u"><?php next_posts_link(sprintf( __( '%s', 'blankslate' ), '<span class="button">← Older Posts</span>' ) ) ?> </div> <div class="6u"><?php previous_posts_link(sprintf( __( '%s', 'blankslate' ), '<span class="button">→ </span>' ) ) ?></div> </nav> </div></div> </section> <?php get_footer(); ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Pagination not working Category Page’ is closed to new replies.