Wordpress : How set and expiration date for RSS Feeds -


first of all, attention,

second, problem.

well, need make rss items disappear after determined date, let say, 15 days. know if there "easy" or "right" way so.

also, if there plugin has configuration or this, name , i'll happily search it.

once again, thanks.

a simple filter on posts_where feeds should work fine:

add_filter('posts_where', 'filter_feed_by_days');  function filter_feed_by_days($where) {     global $wpdb;     if (is_feed()) {         // take 15 days backwards now, , convert gmt compare         // post_date_gmt in database.         $time_limit = gmdate('y-m-d h:i:s', strtotime('-15 days'));         $where .= $wpdb->prepare(             " , $wpdb->posts.post_date_gmt >= %s ",              $time_limit         );     }     return $where; } 

Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -