This question has been a pain in my side for the last few days.
I am using a function to display page numbers and next/previous links with WP_LINK_PAGES. The code I'm using (below) is a shortened version of the code found here - to the best of my knowledge, it is correct. (Go easy on me, just diving into PHP.)
Please view the working example here.
The problem should be a simple fix, but I can't figure it out. I would like to add a space in front of the "Next Page" link which is not linked itself to the next page in order for the pagination to have equal spacing.
function wp_link_pages_args_prevnext_add($args)
{
global $page, $numpages, $more, $pagenow;
if($page-1) # there is a previous page
$args['before'] .= _wp_link_page($page-1)
. $args['link_before']. $args['previouspagelink'] . $args['link_after'] . '</a>'
;
if ($page<$numpages) # there is a next page
$args['after'] = _wp_link_page($page+1)
. $args['link_before'] . $args['nextpagelink'] . $args['link_after'] . '</a>'
;
return $args;
}
margin
, rather than hard-coding the space.