Codice PHP:
<?php
$x = 1;
if(is_home()) {
$options = get_option("widget_sideFeature");
$numberOf = $options['number'];
$category = $options['category'];
$category = "&cat=" . $category;
$showposts = "posts_per_page=" . $numberOf . $category ;
$featuredPosts = new WP_Query();
$featuredPosts->query($showposts);
while ($featuredPosts->have_posts()) : $featuredPosts->the_post();
$notin[] = $post->ID;
endwhile;
$posts = pbt_theme_option('number_posts');
if(empty($posts)) $posts = 6;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
if (is_active_widget('widget_myFeature')) {
$args = array(
'post__not_in'=>$notin,
'posts_per_page'=>$posts,
'paged'=>$paged
);
} else {
$args = array(
'posts_per_page'=>$posts,
'paged'=>$paged
);
}
query_posts($args . '&cat=-24'); //stringa originale senza modifiche query_posts($args);
if(pbt_theme_option('latest_story')=="on" && $paged < 2) { echo '<h5 class="latest">'.__('Latest Story', "magazine-basic").'</h5>'; }
}
?>
Ho realizzato questa modifica(si trova nelle ultime righe), funziona ed escude la cateogira "24", ma la modifica è corretta? Non sono molto preparato in Worpress quindi chiedo conferma.
Grazie per l'aiuto