Cron job to call php to email last 24 hours posts (1 post)

  1. cheltenhammedia
    Posted 2 years ago #

    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.

        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′

    Any php gurus out there that could shed some light on this, or is there an easier way?

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 2 years ago by cheltenhammedia
  • This topic is not resolved
  • WordPress version: 3.5.2