-
AuthorPosts
-
August 13, 2013 at 5:49 pm #3030
Hannah Jeen Evangelio
GuestHi Ron,
I noticed that the WP-Paginate doesn’t work on my website (using your theme) after the recent update. Help please.
I have also tried using this code, after I deactivated the WP-Paginate and inserted this in function.php. This used to work before the update.
function pagination($pages = '', $range = 4) { $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\"><span>Page ".$paged." of ".$pages."</span>"; if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'>« First</a>"; if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>‹ Previous</a>"; for ($i=1; $i <= $pages; $i++) { if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems )) { echo ($paged == $i)? "<span class=\"current\">".$i."</span>":"<a href='".get_pagenum_link($i)."' class=\"inactive\">".$i."</a>"; } } if ($paged < $pages && $showitems < $pages) echo "<a href=\"".get_pagenum_link($paged + 1)."\">Next ›</a>"; if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>Last »</a>"; echo "</div>\n"; } }
This is the css `.pagination {
clear:both;
padding:20px 0;
position:relative;
font-size:11px;
line-height:13px;
}.pagination span, .pagination a {
display:block;
float:left;
margin: 2px 2px 2px 0;
padding:6px 9px 5px 9px;
text-decoration:none;
width:auto;
color:#fff;
background: #555;
}.pagination a:hover{
color:#fff;
background: #3279BB;
}.pagination .current{
padding:6px 9px 5px 9px;
background: #3279BB;
color:#fff;
}`August 13, 2013 at 6:31 pm #3031Ron
KeymasterHi Hannah,
The theme doesn’t natively support WP-Paginate. You can still make it work if you want by editing the index.php template.
Instead, Asteroid theme supports WP-Pagenavi which is a different plugin but is more up-to-date. It works perfectly fine as you can see here on my blog. I also suggest removing the stuff you added on functions.php
I think you’re the first fellow filipino to use the theme 🙂
Thanks,
RonAugust 13, 2013 at 6:57 pm #3032Hannah Jeen Evangelio
InactiveWow that’s a fast reply! Thanks Ron. I’ll try using WP-Pagenavi. (It works!)
Honestly, I never thought you are a Filipino. While looking at your photo, I was thinking you are from Brazil. I was so wrong 😀
Again, thank you.
P.S I like your theme 😉
-
AuthorPosts
- The forum ‘Asteroid’ is closed to new topics and replies.