Problem with showing one category on homepage
-
Having problems with limiting the home page to a single category. My page shows excerpts of all the recent ones in a specfic category but the whole post of the most recent one, regardless of what the category is.
Here’s the relevant bit of code…
<div class="top_Post"> <?php $sticky_counter = 0; ?> <?php query_posts('cat=6'); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php if ( is_sticky() ) { ?> <?php $sticky_counter++; ?> <div id="" class="l_post"> <?php if(get_settings('kasrod_color')<>'') { $background = get_settings('kasrod_color'); } ?> <div class="post" id="post-<?php the_ID(); ?>"> <h3 class="title" style="background:#<?php echo $background;?>; border-bottom:solid 1px #<?php echo $background;?>; "><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3> </div> <p>Written by: <?php the_author_posts_link(); ?> on <?php the_date(); ?> @ <?php the_time(); ?></p> <?php //the_content('Read more'); the_content(); ?> <?php wp_link_pages(); ?> <?php the_tags( '<p>Tags: ', ', ', '</p>'); ?> Catogories: <?php the_category( ', '); ?> <br/> <?php edit_post_link(); ?> <a class="more-link" href="<?php the_permalink() ?>" rel="bookmark" style="color:#<?php echo $background;?>;" title="Permanent Link to <?php the_title_attribute(); ?>">Read more</a> </div> <?php } ?> <?php endwhile; if( $sticky_counter == 0 ) { ?> <p><?php wp_last_posts(1); }?></p> <?php endif; ?> </div>
Have got the
<?php query_posts('cat=6'); ?>
in the wrong place?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Problem with showing one category on homepage’ is closed to new replies.