adding category parameter to query_posts breaks theme
-
When ever I add a category parameter to query_posts the them breaks.
with no category parameter the code works fine.
<?php //The Query query_posts( array ( 'posts_per_page' => 5 ) ); while ( have_posts() ) : the_post(); ?> <div class="home-post"> <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2> <div id="date"><?php the_time('F j, Y'); ?> </div> <div class="clear"></div> <div class="post-content"><?php the_content('Read More »'); ?></div> <div class="post-clear"></div> </div><!--/home-post--> <?php endwhile; wp_reset_postdata(); wp_reset_query(); ?>
as soon as I change the query to this:
//The Query query_posts( array ( 'category_name' => 'flash', 'posts_per_page' => 5 ) );
The template breaks and yields some strange elements on the output code that are breaking the theme. Below is what is output when a category parameter is added to query_posts
<u style="display:none"> <!--Web Page code is in here--></u>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘adding category parameter to query_posts breaks theme’ is closed to new replies.