Changing the current Post when loading single.php file
I need the single.php file to be able to load a different Post (Into the POST object) and to consider the new Post as the current post.
- Current Post ID: 755
- Select Random Post ID: 748
- Load Random Post into Post Object (**** Need to know who to do this**)
- Current Post ID: 748
So, when you call get_the_ID() you will get the Random Post ID, in this example 748…
- Not to be done with a redirect
- Not to be done with basic Post array update, as post loaded needs to be considered as the Random Post
I am using specific posts as a Landing Page split test.
So when the Split Test page is loaded, I select a random post (landing page) to display.
So, I do not want the URL to change, I want the page to load, as the selected random post.