-
Hi there,
I am trying to use Next page buttons for my posts and pages to break up long pages. When I use the next page tag, it just displays a numbered list at the bottom of the page, which doesn’t look very good and is difficult to see.
How can I get a nice big styled NEXT and PREVIOUS page button to display on my posts and pages when I break them up using the nextpage tag?
Please note I am using the text editor, not Gutenberg (which I cannot stand!)
Thanks
-
Hi there,
can you share a link to a page on your site where i can see this ?
-
-
Ok, add this PHP Snippet:
add_filter( 'wp_link_pages_args', function( $args ) { $args['next_or_number'] = 'next'; return $args; } );
It will replace the numbers with next/previous.
Once thats in place we can look at CSS to style it.
-
I can add the snippet using my code snippets plugin, right? Do I add it to that page only??
-
Yeah you can add it to your Code Snippets, and let it run everywhere
-
I had to add it as a site-wide footer since it only allows me to run everywhere if it’s PHP code. Is there a better way than in the footer?
-
I am not familiar with that plugin anymore – it seems they added more options.
As its PHP it should just run everywhere, but it should not be added as a footer ?
-
The option is not available to run everywhere.
PHP Snippets Only
Run Everywhere
Snippet gets executed everywhere on your website.I am assuming it does not recognise the code as PHP
-
The above is greyed out, and I cannot select it, presumably because it does not recognise the code as PHP as I said.
-
I can’t really troubleshoot that plugin – but which one are you using ?
Is it this:
https://wordpress.org/plugins/code-snippets/ -
Aha – I changed the type to PHP and it worked – it’s now added everywhere.
Now what?
-
Well I got Chat GPT to style the buttons and it is working. Still trying to figure out how to remove “pages”, but looks like we can close this call.
Thanks for everything!
-
Glad to hear that!
- You must be logged in to reply to this topic.