Solved: Read More is pointing to the wrong URL
-
I have seen some unresolved threads on this issue, all of which were closed. I bumped into this problem saving results from a query for later use, and using setup_postdata to gain access to template tags – the read more was using the last post in the loop for the rest of the page.
The reason for this is that it uses get_permalink, which in turn uses $post, as far as I can tell. If $post is not being set to the current data, you will not get the correct permalink, even if the_content is returning the correct content.
Setting $post, or at least $post->ID, does the trick.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Solved: Read More is pointing to the wrong URL’ is closed to new replies.