Jump to content

siouxfan45

New Members
  • Posts

    1
  • Joined

  • Last visited

siouxfan45's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. 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; }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.