Pagination Does Not Work

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #3030 Reply

    Hannah Jeen Evangelio

    Hi 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)."'>&laquo; First</a>";
             if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>&lsaquo; 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 &rsaquo;</a>";  
             if ($paged < $pages-1 &&  $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>Last &raquo;</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;
    }`

    #3031

    Ron
    Keymaster

    Hi 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,
    Ron

    #3032

    Hannah Jeen Evangelio

    Wow 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 😉

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Pagination Does Not Work
Your information: