I have an interesting task. I've wrote custom 404 handler for wordpress and extracted an URL. Than, after doing some logic I've got a wordpress post ID that I need to display instead of 404 page.
How can I display a wordpress post page instead of 404 page? The only thing I can think of is do
echo wp_remote_fopen(....<post permalink>...);
But is there any alternative way to do that? Thanks