Hey there,
I'm currently creating a custom theme, yet for some reason my pagination code is acting weird
Here's the PHP code i'm running:
echo '<div class="text-center">';
echo '<ul class="pagination">';
$pagination = paginate_links( array(
'base' => '%_%',
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'end_size' => '2',
'mid_size' => '2',
'prev_next' => 'true',
'prev_text' => '«',
'next_text' => '»',
'type' => 'array',
'add_args' => False,
'add_fragment' => '',
'before_page_number' => '',
'after_page_number' => ''
));
foreach ($pagination as $link)
{
if (strpos($link,'span') !== false)
echo '<li class="active">' . str_replace(array("<span class='page-numbers current'>",'</span>'),array('<a href="#">','</a>'),$link) . '</li>';
else
echo '<li>' . $link . '</li>';
}
echo '</ul>';
echo '</div>';
and here's the HTML which that PHP code produces
<div class="text-center">
<ul class="pagination">
<li><a class="prev page-numbers" href="">«</a></li>
<li><a class='page-numbers' href=''>1</a></li>
<li class="active"><a href="#">2</a></li>
<li><a class='page-numbers' href='?paged=3'>3</a></li>
<li><a class="next page-numbers" href="?paged=3">»</a></li>
</ul>
</div>
here's the website i'm working on: http://www.mohairmetflair.nl/blog/?paged=2
as you can see, i'm currently on page 2, and while navigating to page 3 works fine, the buttons for "previous page" and page 1 contain no URL in their href from when the pagination is created
not only that, but the HTML seems to be swapping between using single and double quotes at random
Thanks in advance for any help you're able to provide on this issue