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.

Of course there is a Drafts section in Post and Pages, but how would I make an Archive section - which would contain previously published posts and page?

share|improve this question
    
Which criteria do you use to check if a post should be in the archives or not? Perhaps you can try using a category if you want to decide it on your own for each post... –  Sven May 23 '13 at 14:57
    
well, the user would change the status to 'published' to 'archived', and then it would not appear to visitors –  cannyboy May 23 '13 at 15:00

2 Answers 2

You can add a custom post status via register_post_status, but I'll warn you now that the API only half exists for this. You won't see any UI to allow you to set this status, you'll have to provide your own via a custom meta box, and you won't see anything on the back-end to allow you to filter on this status until you've assigned the status to a post.

share|improve this answer

It's not quite easy to deal with register_post_status yet, as it's not meant to be used within themes or plugins, but there is a nice plugin called Edit Flow which will do the job. Use the interface within the plugin to register your new post status and it will automatically appear in the dropdown menu beside your post.

Post Status

You'll get the current status of the blogpost via get_post_status:

<?php
   if ( get_post_status ( $ID ) == 'archived' )
   {
      echo 'archived';
   }
   else
   {
      echo 'public';
   }
?>
share|improve this answer

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.