Problems with pagination in category.php
-
Have problems to get to page 2/3/4 etc with my categorys from the posts. I get error that the page is not found. The theme is homemade using WP 3.8 and Bootsrap 3.0 in the bottom.
I think the trouble is in line
$wp_query->query('showposts=1' . '&paged='.$paged . '&cat=' . $cat);
, any suggestions?
<?php get_header(); ?> <a href="../blogg/"><h1 class="tunn grey" style="clear: both;">Blogg</h1></a> <div class="blogg col-xs-12 col-sm-10 col-md-10"> <article> <?php // Display blog posts on any page @ https://m0n.co/l $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query(); $wp_query->query('showposts=1' . '&paged='.$paged . '&cat=' . $cat); while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <div class="info col-xs-5 col-sm-2 col-md-2"> <div class="blogdate col-xs-0 col-sm-0 col-md-0"> <p class="post-day"><?php the_time('j') ?> </p> <p class="post-month"><?php the_time('F') ?> </p> <p class="post-year"><?php the_time('Y') ?> </p> </div> </div> <div class="post col-xs-12 col-sm-10 col-md-10"><h2><a>" title="L?s mer"><?php the_title(); ?></a></h2> <?php the_content(); ?> <div class="tunn"></div> </div> <?php endwhile; ?> <?php if ($paged > 1) { ?> <nav id="nav-posts"> <?php wp_pagenavi(); ?> </nav> <?php } else { ?> <nav id="nav-posts" > <?php wp_pagenavi(); ?> </nav> <?php } ?> <?php wp_reset_postdata(); ?> </article> </div> <div class="blogg col-xs-12 col-sm-12 col-md-2 pull-right"> <?php get_sidebar(); ?> </div>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Problems with pagination in category.php’ is closed to new replies.