De multe ori faci un articol si iti dai seama ca ai facut o greseala. Doresti sa il schimbi dar degeaba deoarece el se gaseste in feed!

Ce poti face? Te poti folosi de urmatorul hack si sa amani postarea unui articol in feed cu un anumit numar de minute.


function publish_later_on_feed($where) {
global $wpdb;

if ( is_feed() ) {
// timestamp in WP-format
$now = gmdate('Y-m-d H:i:s');

// value for wait; device
$wait = '10'; // integer

// http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_timestampdiff
$device = 'MINUTE'; //MINUTE, HOUR, DAY, WEEK, MONTH, YEAR

// add SQL-sytax to default $where
$where .= " AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, '$now') > $wait ";
}
return $where;
}

add_filter('posts_where', 'publish_later_on_feed');

Facebook Comments
Citeste si:   Wordpress: afiseaza continut din RSS pe site-ul tau

Spune si tu parerea...