After spending the greater part of the last 8 hours trying without success to make this work.
I have searched WordPress.org, and on Google for a plugin or other solution.
First I found: http://www.sitpic.com/rotea-expire-posts.phps — to which the links do not work
any longer, because apparently the plugin stopped working for unknown reasons around the first of
— I finally came upon some code here:
in addition to this old discussion: http://wordpress.org/support/topic/10546
I tried everything suggested, including rereading “Loop” articles in the Wiki.
I added the following to the loop in the theme’s index.php file. My theme uses single.php not post.php, though
I’m not sure that even applies:
<?php list ($post_expired) = get_post_custom_values(‘postexpire’); /* only pay attention to the first one if there’s a duplicate */ ?>
<?php if ( !$post_expired || current_time(‘mysql’) < $post_expired) : /* if there’s no expiration date or it’s not been reached yet, go ahead with displaying the post */ ?>
After adding the above code and trying to view the site, the index.php (website’s homepage) is BLANK. Remove the code
from the index.php file and the front page of the blog/website displays perfectly.
I’m not sure if there is something that has changed in WordPress 2.0, but I really would like to get this working
so that everyone has the option of expiring posts. According to what I’ve read this will still make the posts
accessible from the admin section, but they will not be viewable on the site. This is perfect for my purposes,
and I cannot believe this isn’t already a hot plugin.
Any help on what I am doing wrong would be helpful. I did already add the key of postexpire and followed
the instructions at http://www.bonniewren.com/2005/postexpire.htm for the value. I’ve really exhausted
every avenue I can think of to try.
- The topic ‘Trying to make certain posts expire in WordPress 2.0’ is closed to new replies.