Visualizzare Articoli aventi una data futura
Questa procedura spiega come modificare WordPress per visualizzare post con data nel futuro.
nota: Questa modifica è stata verificata solo su wp 1.5.2 e 1.5.1.3 non c'è nessuna garanzia che questo metodo funzioni con le versioni precedenti ne tanto meno con le successive.
nel file /wp-includes/classes.php alla riga 492 sostituire
$now = gmdate('Y-m-d H:i:59');
con
// modifica: in questo modo visualizza tutti i post, anche quelli futuri!!!!
// $now = gmdate('Y-m-d H:i:59');
$now = '9999-01-01 00:00:00';
inoltre per far sì che il calendario link mostri anche i post futuri, nel file
/wp-includes/template-functions-general.php
alla riga 479 sostituire
// Get days with posts
$dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date)
FROM $wpdb->posts WHERE MONTH(post_date) = $thismonth
AND YEAR(post_date) = $thisyear
AND post_status = 'publish'
AND post_date < '" . current_time('mysql') . ''', ARRAY_N);
con
// Get days with posts
$dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date)
FROM $wpdb->posts WHERE MONTH(post_date) = $thismonth
AND YEAR(post_date) = $thisyear
AND post_status = 'publish' "
// riga commentata per visualizzare tutti i link,
// anche quelli dei post futuri del mese!
/* AND post_date < '" . current_time('mysql') */, ARRAY_N);
Ultima modifica il 09/03/2006 ore 06:12