I just transformed my query_posts function in a get_posts function.
Here is my old function:
<?php
// The Query
query_posts( 'cat=170&showposts=4' );
remove_filter('the_excerpt', 'wpautop');
// The Loop
while ( have_posts() ) : the_post();
echo '<h3 style="font-size:14px"><a href="';the_permalink(); echo '" title="';the_title(); echo '"> '; the_title(); echo '</a></h3> <div class="ultimipostexcerpt">'; the_excerpt(); echo '</div>';
endwhile;
// Reset Query
wp_reset_query();
?>
Here's my new one
<?php
$args = array( 'posts_per_page' => 4, 'category' => 170 );
$tag_posts = get_posts( $args );
foreach ( $tag_posts as $post ) :
setup_postdata( $post ); ?>
<h3 style="font-size:14px"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3><div class="ultimipostexcerpt"><?php the_excerpt(); ?></div>
<?php endforeach;
wp_reset_postdata(); ?>
The problem is that now the remove_filter('the_excerpt', 'wpautop');
directive doesn't work anymore.. I tried putting it before and after get_posts( $args );, doesn't affect the output.. :( how can I remove the filter for get_posts too?