Support » Plugins » Getting private post from outside WP

  • 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!

Viewing 1 replies (of 1 total)
  • What happens if you add ‘post_status=private’ to your parameters?

    $query = “post_status=private&p=” . SURVEY_POST_ID;

Viewing 1 replies (of 1 total)
  • The topic ‘Getting private post from outside WP’ is closed to new replies.