Multiple loops are not reset

At the end of your news.php, use wp_reset_query(). This will revert to the default query for that page. Hope this helps! Codex Function Reference for wp_reset_query()

Custom loop with multiple taxonomy queries

Here’s a function to do a query with multiple taxonomies: function posts_search ($post_type,$taxonomies) { // $taxonomies should be an array (‘taxonomy’=>’term’, ‘taxonomy2’=>’term2’) foreach ($taxonomies as $key=>$value) { $args=array(‘post_type’=>$post_type,’post__in’=>$ids,$key=>$value); unset($ids); $ids=array(); foreach($posts=get_posts($args) as $post) { $ids[]=$post->ID; } if (empty($ids)) return false; } return $posts; } And here’s an example on how i used it in a … Read more

Recent posts on a static home page

First, Welcome! I guess you use the file front-page.php for displaying your homepage. What you have to do, is add the following code into your front-page.php: <h2>Recent Posts</h2> <ul> <?php $args = array( ‘numberposts’ => ‘5’ ); $recent_posts = wp_get_recent_posts( $args ); foreach( $recent_posts as $recent ){ echo ‘<li><a href=”‘ . get_permalink($recent[“ID”]) . ‘” title=”Look … Read more

Get search.php results in header.php?

Now, is it possible to check if page is the search page is_search() AND what’s the search string is_search() AND print get_query_var( ‘s’ ) AND how many posts were found? is_search() AND print $GLOBALS[‘wp_query’]->number_posts() … or if you got a custom query… $my_query = new WP_Query( array( /* whatever args */ ) ); is_search() AND … Read more

How to display posts on a static page? (like search loop)

You could use query_posts() to set up a new loop in your page. Assuming that the posts you want are in the category ‘Noticias’, with a slug of ‘noticias’: query_posts( ‘category=noticias’ ); if( have_posts() ) { get_template_part( ‘loop’, ‘index’ ); } wp_reset_query(); // probably not necessary, if you don’t have a pre-existing Loop