io l'ho infilato direttamente nel codice senza usare hook. Mi sembra che facesse difetto sull'ultima pagina se ci sono meno di 3 post, ma non ho ancora avuto tempo di correggere, e attualmente ho 4 post, quindi si vede bene. Ti passo il codice, si tratta del file loop-magazine.php
Codice PHP:
<?php
/**
* Loop - Magazine
*
* This is the loop logic file for the "Magazine" page template.
*
* @package WooFramework
* @subpackage Template
*/
global $woo_options, $paged;
global $more; $more = 0;
remove_action( 'woo_post_inside_before', 'woo_display_post_image', 10 );
// woo_loop_before() is loaded in the main template, to keep the magazine slider out of this file.
// Exclude stored duplicates
$exclude = '';
$cats = array();
$cats_exclude = array();
// Exclude slider posts
if ( $woo_options['woo_slider_magazine_exclude'] == 'true' ) {
$exclude = get_option( 'woo_exclude' );
}
// Exclude categories
$cats = explode( ',', $woo_options['woo_magazine_exclude'] );
if ( !empty($cats) ) {
foreach ($cats as $cat)
$cat_exclude[] = '-' . $cat;
}
// Fix for the WordPress 3.0 "paged" bug.
$paged = 1;
if ( get_query_var( 'paged' ) ) { $paged = get_query_var( 'paged' ); }
if ( get_query_var( 'page' ) ) { $paged = get_query_var( 'page' ); }
$paged = intval( $paged );
$args = array( 'cat' => join( ', ', $cat_exclude ),
'paged'=> $paged );
if ( $exclude != '' ) {
$args['post__not_in'] = $exclude;
}
query_posts( $args );
if ( have_posts() ) { $count = 0; $column_count_1 = 0; $column_count_2 = 0;
?>
<div class="fix"></div>
<?php
while ( have_posts() ) { the_post(); $count++;
if($count == 3) {
?>
<div style="text-align: center; margin-bottom:20px;margin-top:-10px;padding-bottom:20px;border-bottom: 1px solid #A67600;">
<script type="text/javascript">
/* <![CDATA[ */
google_color_border = "FFF";
google_color_bg = "FFFFFF";
google_color_link = "222222";
google_color_url = "A65600";
google_color_text = "444444";
google_ui_features = "rc:0";
document.write('<s'+'cript type="text/javascript" src="http://ad.altervista.org/js2.ad/size=468X60/r='+new Date().getTime()+'"><\/s'+'cript>');
/* ]]> */
</script>
</div>
<?php
}
// Featured Starts
if ( $count <= $woo_options['woo_magazine_feat_posts'] && ! is_paged() ) {
woo_get_template_part( 'content', 'magazine-featured' );
continue;
}
$column_count_1++; $column_count_2++;
?>
<div class="block<?php if ( $column_count_1 > 1 ) { echo ' last'; $column_count_1 = 0; } ?>">
<?php woo_get_template_part( 'content', 'magazine-grid' ); ?>
</div><!--/.block-->
<?php
if ( $column_count_1 == 0 ) { ?><div class="fix"></div><?php } // End IF Statement
} // End WHILE Loop
} else {
get_template_part( 'content', 'noposts' );
} // End IF Statement
woo_loop_after();
?>
<div style="text-align: center; margin-bottom:20px;margin-top:-10px;padding-bottom:20px;border-bottom: 1px solid #A67600;">
<script type="text/javascript">
/* <![CDATA[ */
google_color_border = "A67600";
google_color_bg = "FFFFFF";
google_color_link = "222222";
google_color_url = "A65600";
google_color_text = "444444";
google_ui_features = "rc:0";
document.write('<s'+'cript type="text/javascript" src="http://ad.altervista.org/js.ad/size=468X60/r='+new Date().getTime()+'"><\/s'+'cript>');
/* ]]> */
</script>
</div>
<?php
woo_pagenav();
add_action( 'woo_post_inside_before', 'woo_display_post_image', 10 );
?>