Cron job to call php to email last 24 hours posts
-
We have been trying to call via CronJob a php script that will email the past 24 hours posts using the ‘post_type’ = ‘reservations’ filter.
Below we have been using some script from a previous forum post but just cannot get it to work, the emails are coming through blank.
<?php function filter_where($where = ”) { $where .= ” AND post_date > ‘” . date(‘Y-m-d’, strtotime(‘-1 days’)) . “‘”; return $where; } add_filter(‘posts_where’, ‘filter_where’); $args = array( ‘paged’–> $paged, ‘post_type’ => ‘reservations′ ); query_posts($args); ?>
Any php gurus out there that could shed some light on this, or is there an easier way?
- The topic ‘Cron job to call php to email last 24 hours posts’ is closed to new replies.