How to read private post with PHP?
-
I have a PHP application where, when a user accesses a certain static page with a certain code, my software reads a blog post from the local blog, insert an audio player and displays the result as an augmented blog post.
I do this by using file_get_contents() on the blog url and then I insert the audio player.
BUT, the client wants those blog posts to be hidden from the general public and only visible when viewed through my custom page (that adds the audio)
Once a blog post is set to private, of course my code fails to read the blog post. I’m looking for some way to read an entire private blog page via PHP. Any thoughts? I could use get_post() but that just returns the post (and other things). I need everything else that surrounds it such as the template, the CSS, the blog post comments, the side bar etc.
- The topic ‘How to read private post with PHP?’ is closed to new replies.