siouxfan45 Posted January 5, 2013 Share Posted January 5, 2013 I have a custom filter for WordPress' wp_link_pages which allows both next/previous links and pagination to be used. However, I have an extra linked space in front of 'Next page' I can't seem to get rid of. I need to maintain the spacing while de-linking the extra space in front of "Next page". I was able to figure out how to remove the space itself, but I really just need to remove the linking from the space. The problem can be viewed in this post. add_filter('wp_link_pages_args', 'wp_link_pages_args_prevnext_add'); /*** Add prev and next links to a numbered link list */ function wp_link_pages_args_prevnext_add($args) { global $page, $numpages, $more, $pagenow; if (!$args['next_or_number'] == 'next_and_number') return $args; # exit early $args['next_or_number'] = 'number'; # keep numbering for the main part if (!$more) return $args; # exit early 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>' . $args['after'] ; return $args; } Link to comment https://forums.phpfreaks.com/topic/272726-attempting-to-remove-rogue-space/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.