kkaiser1
Forum Replies Created
Viewing 1 replies (of 1 total)
-
Forum: Themes and Templates
In reply to: is_home in sidebarI’m having the same problem but
wp_reset_query();isn’t working for me. is_home fails to recognize this template ever since I added the category call below:
query_posts(‘category_name=Music&posts_per_page=5’);
Here is my home.php code
<?php get_header(); ?> <div id="container"> <div id="content"> <?php //The Query query_posts('category_name=Music&posts_per_page=5'); //The Loop while ( have_posts() ) : the_post(); ?> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> <div class="entry-meta"> <?php printf( __( '<span class="meta-prep meta-prep-author">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a> <span class="meta-sep"> by </span> <span class="author vcard"><a class="url fn n" href="%4$s" title="%5$s">%6$s</a></span>', 'twentyten' ), get_permalink(), esc_attr( get_the_time() ), get_the_date(), get_author_posts_url( get_the_author_meta( 'ID' ) ), sprintf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ), get_the_author() ); ?> </div><!-- .entry-meta --> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> </div><!-- .entry-content --> <div class="entry-utility"> <span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php echo twentyten_cat_list(); ?></span></span> <span class="meta-sep"> | </span> <?php $tags_text = twentyten_tag_list(); ?> <?php if ( ! empty( $tags_text ) ) : ?> <span class="tag-links"><span class="entry-utility-prep entry-utility-prep-tag-links"><?php echo $tags_text; ?></span></span> <span class="meta-sep"> | </span> <?php endif; //$tags_text ?> <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span> <?php edit_post_link( __( 'Edit', 'twentyten' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t\n" ); ?> </div><!-- #entry-utility --> </div><!-- #post-<?php the_ID(); ?> --> <?php comments_template( '', true ); ?> <?php endwhile; wp_reset_query();?> </div><!-- #content --> </div><!-- #container --> <?php get_sidebar(); ?> <?php get_footer(); ?>
Viewing 1 replies (of 1 total)