I have a large post split with <!-- nextpage -->
. A term resides on page 50. When I search for the term, I land on page#1.
Q: How can the system auto-forward me to page#50?
Thanks
I have a large post split with <!-- nextpage -->
. A term resides on page 50. When I search for the term, I land on page#1.
Q: How can the system auto-forward me to page#50?
Thanks
You must be logged in to post a comment.
UPDATE: After I needed this myself, I reworked it completely.
The Goal
I wanted to point every
get_permalink()
call directly to the paged post page – without any exception. At least this is the function used by nearly every other function that needs to link somewhere, so it imo also is the most reliable.What the plugin does
It jumps in when WP is fully loaded and adds an action/callback function to the
the_post
-hook. There it then checks the globals$numpages
(holds the number of pages a post has) and$pages
(holds the parts a post is splitted up by using<!--nextpost-->
in the content). If the number of pages is not larger than1
, it aborts. Else it searches through the posts pages for the searched string. If it was found, then it sets the$link
class property to the page link using_wp_link_page()
. This link then gets attached inside the filters offered byget_permalink()
.What for does it work?
It works for posts, pages & custom post types
The plugin
As everytime: Free for use. Grab it, use it. Have fun with it.