Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm currently publishing articles to wordpress as "Private", as I don't want them to be viewable on the website. However I do need an RSS feed of these posts. Any suggestions on how to go about creating an RSS feed of posts that aren't viewable on my site?

share|improve this question

1 Answer 1

I assume your theme already has a 'feed-rss.php' (if not, here's how they work: http://codex.wordpress.org/Customizing_Feeds)

You'll need to pass a few parameters to the query before you loop through them.

//Get all posts that are private or public
$the_query = new WP_Query( array( 'post_status' => array( 'private', 'publish' ) );
while ( $the_query->have_posts() ) {
    //do stuff
}

For more parameters: http://codex.wordpress.org/Class_Reference/WP_Query#Status_Parameters

share|improve this answer
    
Hmm... I wonder if there is a nicer way to do this with this codex.wordpress.org/… –  David Kryzaniak Jul 9 '13 at 20:40
    
Where should that code be inserted? I set up a custom feed template which is working. However when I insert your code into the feed template I get a 500 error. (Also, your code is missing a close parentheses). –  Nick5a1 Jul 9 '13 at 21:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.