3

i want to display all posts as well as count the days of the post since it was published

if ($pageposts):
  foreach ($pageposts as $post):
        setup_postdata($post);
    echo '<p>';

   the_title();

   echo '</p>';
  endforeach;
endif;

Output should be something like this

Post Title1 - This post is published 4 days ago Post Title2 - This post is published 3 days ago Post Title3 - This post is published 6 days ago

and at the same time i want to delete the post once it reaches 10 days

I really need your help guys thanks i appreaciate it alot

3 Answers 3

1

Use http://wordpress.org/extend/plugins/simple-expires/

0

There's a small thread in WordPress support for this question, they recommend two plugins, Post Expirator and Auto Prune Posts.

0

check this tutorial - WordPress: make posts expire or auto-delete

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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