Welcome! To use this support forum, please Login or Join Today!

   

Pagination arrows on blog home

{name}
Rank

Total Posts: 23

Joined 2015-08-06

PM

 

Hi Casey,

Taking a look in content_functions.php I see the pagination function listed below. I see left (previous) and right (next) arrow entities, but the arrows don’t appear in the actual HTML output – only the page numbers. I’m wondering how to display these arrows. Ideally, I’m looking to replace the left and right HTML arrow entities with spans so that I can style them with vector-based arrows instead (see attached mockup).

Would you be kind enough to help me troubleshoot this, please sir? Any help is greatly appreciated.

/*-----------------------------------------------------------------------------------*/
// PAGE NAVIGATION
/*-----------------------------------------------------------------------------------*/


// Pages
if (! function_exists('st_page_pagenavi'))  {

function st_page_pagenavi() {
   
echo '<div class="pagination">';
   
wp_link_pages(array('before' => '''after' => '''next_or_number' => 'number'));
   echo 
'</div>';
}
// endif

if (! function_exists('st_pagenavi'))  {
//Posts
function st_pagenavi($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(!= $pages)
     
{
         
echo "<div class='pagination'>";
         if(
$paged && $paged $range+&& $showitems $pages) echo "<a href='".get_pagenum_link(1)."'>&laquo;</a>";
         if(
$paged && $showitems $pages) echo "<a href='".get_pagenum_link($paged 1)."'>&lsaquo;</a>";

         for (
$i=1$i <= $pages$i++)
         
{
             
if (!= $pages &&( !($i >= $paged+$range+|| $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)."'>&rsaquo;</a>";
         if (
$paged $pages-&&  $paged+$range-$pages && $showitems $pages) echo "<a href='".get_pagenum_link($pages)."'>&raquo;</a>";
         echo 
"</div>\n";
     
}
}
// endif 


Attachments:

https://www.filepicker.io/api/file/vQJw0Z4XSx2dY849znCF