By default, when adding <!--nextpage-->
, the following links are displayed:
Pages: 1 2
I need to replace “Pages:” with a graphic arrow which links back to the previous page, and append a graphic arrow to the end of the links that links to the next page. I’m guessing there’s a way to do this in the functions file?
Just specify an image as the “nextpagelink” and “previouspagelink” instead of the << or >>:
Also, you are correct that by default you are limited to either “Numbers” or “Next/Previous” links but a plugin can extend this: http://wordpress.org/extend/plugins/wp-pagenavi/
Bonus: Add this to your function.php and it will add a “Nextpage” button next to the “More” button in the WYSIWYG editor:
I have to admit that
<!--nextpage-->
isn’t a very well-documented feature (there’s not even a button for it in the UI of the post editor!). But it’s still incredibly useful and I’ve used it a few times to break up longer posts on my own site.According to what documentation exists, though, this tag uses the function
wp_link_pages()
. This function accepts a few parameters that allow you to style the output as needed.In your case, you’d want to use the
next_page_link
andprevious_page_link
arguments.So at the bottom of
single.php
, use the following code to generate your page links:This will replace the page numbers with << and >> arrows. It will also remove the “Pages:” text while keeping your links contained within a
<p></p>
block.Related: