loops - Wordpress pagination showing same content on page 2 -
i can’t link site i’m working on because it’s running locally right now. i’m trying use pagination on home page happens it’s displaying link page 2 , page 3 it’s not showing different content when click links.
i’m using bootstrap framework (no plugin). want try pagination without using plugin.
i have query running on home page pulls in latest 3 posts first 3 columns (1,2,3).
i have additional query running on home page pulls in next 3 posts 3 columns beneath first 3 (4,5,6).
when pagination displays, click on numbers , url changes in address bar content remains same. there way can use pagination continue display 3 columns on top , 3 columns on bottom?
please help, thanks!
in functions.php have:
function bootstrap_pagination($pages = '', $range = 2) { $showitems = ($range * 2)+1; global $paged; if(empty($paged)) $paged = 1; if($pages == '') { global $wp_query; $pages = $wp_query->max_num_pages; if(!$pages) { $pages = 1; } } if(1 != $pages) { echo "<div class='pagination pagination-centered'><ul>"; if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<li><a href='".get_pagenum_link(1)."'>«</a></li>"; if($paged > 1 && $showitems < $pages) echo "<li><a href='".get_pagenum_link($paged - 1)."'>‹</a></li>"; ($i=1; $i <= $pages; $i++) { if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems )) { echo ($paged == $i)? "<li class='active'><span class='current'>".$i."</span></li>":"<li><a href='".get_pagenum_link($i)."' class='inactive' >".$i."</a></li>"; } } if ($paged < $pages && $showitems < $pages) echo "<li><a href='".get_pagenum_link($paged + 1)."'>›</a></li>"; if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo "<li><a href='".get_pagenum_link($pages)."'>»</a></li>"; echo "</ul></div>\n"; } }
query 1 looks this:
<div id="post-<?php the_id(); ?>" class="span4"> <div class="our-work-thumbs"> <?php // check if post has post thumbnail assigned it. if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?> <h4><?php the_title(); ?> - <span><a href="<?php the_permalink() ?>" rel="bookmark" title="permanent link <?php the_title(); ?>">view project</a></span></h4> </div> </div> <?php $count1++; } ?> <?php endforeach; ?> </div> <!------------ first row ---------------->
query 2 looks this:
<div id="post-<?php the_id(); ?>" class="span4"> <div class="our-work-thumbs"> <?php // check if post has post thumbnail assigned it. if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?> <h4><?php the_title(); ?> - <span><a href="<?php the_permalink() ?>" rel="bookmark" title="permanent link <?php the_title(); ?>">view project</a></span></h4> </div> </div> <?php $count2++; } ?> <?php endforeach; ?> </div> <?php endif; ?> <!------------ second row ---------------->
Comments
Post a Comment