I need to get a private post from outside of WordPress. It works fine with a public post, but not private. Here’s the code:
$query = "p=" . SURVEY_POST_ID; $wp_query->query($query);
That works exactly how I would like with public posts. I can get the private post using:
$thisPost = get_post($id = 1);
but then comments don’t work (and that’s all I really need, I don’t even need the post info, just to add and view its comments). So, I either need the first code block to work getting a private post, or I need the second one to setup everything so that comments will work. Please point me in the right direction. Thanks a million!
- The topic ‘Getting private post from outside WP’ is closed to new replies.