WordPress : Modifier "RECENT_POST".
Comment modifier le "recent_post" par catégorie :
Chemin :
wp-includes/default-widgets.php
Changer la ligne :
$r = new WP_Query( apply_filters( 'widget_posts_args', array(
'posts_per_page' => $number,
'no_found_rows' => true,
'post_status' => 'publish',
'ignore_sticky_posts' => true
) ) );
if ($r->have_posts()) :
PAR
$r = new WP_Query( apply_filters( 'widget_posts_args', array(
'posts_per_page' => $number,
'category__not_in' => array( 1,3,4 ),
'no_found_rows' => true,
'post_status' => 'publish',
'ignore_sticky_posts' => true
) ) );
Pour exclure les catégories 1, 3 et 4 et afficher uniquement 2:
'category__not_in' => array( 1,3,4 ),