Пример #1
0
    }
}
while ($query->have_posts()) {
    $query->the_post();
    /* Check: last 24hrs? */
    if (time() - get_the_time('U') <= 86400) {
        $l = get_permalink();
        $t = SendoutBuilder::string_max(get_the_title(), 85);
        //get the categories into a simple list...
        $cats_raw = get_the_category();
        $cats = array();
        foreach ($cats_raw as $category) {
            $cats[] = $category->cat_name;
        }
        //get the excerpt at a good length
        $e = SendoutBuilder::string_max(get_the_excerpt(), 270);
        $image = get_the_post_thumbnail(get_the_ID(), 'thumbnail');
        $i = SendoutBuilder::get_img_src($image);
        //add it to our temporary storage
        $builder->add_article($cats, $t, $e, $l, $i);
    }
}
?>

<!DOCTYPE html>
<html>
<head>

</head>

<body>