• Hi hope u all will be fine. i have 3 template files for category, archive and tag Pages with the name category.php , archive.php and tag.php respectively. now the problem is that when i click and category , archive or tag link instead of showing specific category posts, archive posts or post with specific tags my templates shows all post. i have following code on all templates and this code is also on my index page, please tell me what is the problem.

    <?php get_header(); ?>
    
    <div id="body_wrap">
      <div id="home-leftcol">
       <!--Featured Post-->
    <div class="featured_post">
    	 <?php query_posts('category_name=featured&showposts=1');  ?>
    	 <?php $ids = array();?>
      	  <?php if (have_posts()) : ?>
      	  <?php while (have_posts()) : the_post(); ?>
    <?php   $ids[] = get_the_ID();  ?>
       <div class="post" id="post-<?php the_ID();?>">
            <div class="post-title">
              <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
    		  <?php if (strlen($post->post_title) > 47) {
    echo substr(the_title($before = '', $after = '', FALSE), 0, 47) . '...'; } else {
    the_title();
    } ?>
    <span class="items">Featured</span>
    </a></h1>
                    <div class="postdate"><?php the_time('M') ?> <?php the_time('d') ?>, <?php the_time('Y') ?></div>
            <span class="postcat"><?php the_category(', ') ?></span> <span class="postcomment"><?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></span>
            </div>
            <div class="entry">
    	          <!--Custom Article Image Field -->
      <ul class="post_image">
        <?php //get article_image (custom field) ?>
        <?php if ($image = get_post_meta($post->ID, 'post-image', true)){ ?>
        <li><a href="<?php the_permalink() ?>"><img src="<?php echo $image; ?>" alt="<?php the_title(); ?>" class="post_image"/><span class="<?php echo get_post_meta($post->ID, 'post-type', true); ?>"></span></a></li>
      <?php }
    ?>
      </ul>
            <!--/Custom Article Image Field -->
    		<?php  the_excerpt(); ?>
    		<div class="clear">
    
    	      <div class="featured_related">Related Posts:</div>
    	      <?php related_posts(array(limit=>3)) ?>
    	    </div>
    		<!--Google Ad -->
    		<div class="left">
      <script type="text/javascript"><!--
    google_ad_client = "pub-4139959960483457";
    /* 468x60, created 7/7/09 */
    google_ad_slot = "0502606764";
    google_ad_width = 468;
    google_ad_height = 60;
    //-->
    </script>
    <script type="text/javascript"
    src="https://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    
      </div>
      <!--/Google Ad -->
      </div>
      <div class="left">
    </div>
      	<hr class="hidden" />
    
              </div>
            <!--/post -->
    
          <?php endwhile; ?>
    
          <?php else : ?>
                <?php endif; ?>
              <!--/content -->
      </div>
    
       <!--/Featured Post-->
    
      	 <?php query_posts(array('post__not_in'=>($ids)));  ?>
    <?php if (have_posts()) : ?>
      	<?php while (have_posts()) : the_post(); $loopcounter++; ?>
    	    <div class="post" id="post-<?php the_ID();?>">
          <div class="post-title">
            <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
    		  <?php if (strlen($post->post_title) > 55) {
    echo substr(the_title($before = '', $after = '', FALSE), 0, 55) . '...'; } else {
    the_title();
    } ?>
    </a></h1>
                  <div class="postdate"><?php the_time('M') ?> <?php the_time('d') ?>, <?php the_time('Y') ?></div>
          <span class="postcat"><?php the_category(', ') ?></span> <span class="postcomment"><?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></span>
          </div>
          <div class="entry">
    	        <!--Custom Article Image Field -->
    <ul class="post_image">
      <?php //get article_image (custom field) ?>
      <?php if ($image = get_post_meta($post->ID, 'post-image', true)){ ?>
      <li><a href="<?php the_permalink() ?>"><img src="<?php echo $image; ?>" alt="<?php the_title(); ?>" class="post_image"/><span class="<?php echo get_post_meta($post->ID, 'post-type', true); ?>"></span></a></li>
    <?php } else {
    ?>
      <li><a href="<?php the_permalink() ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/wp-content/themes/it-aroma/images/no_screenshots.gif" alt="<?php the_title(); ?>" class="post_image"/><span class="<?php echo get_post_meta($post->ID, 'post-type', true); ?>"></span></a></li>
    <?php }
    ?>
    </ul>
          <!--/Custom Article Image Field -->
    
    	  <?php if (get_post_meta($post->ID, 'post-type', true) == video || get_post_meta($post->ID, 'post-type', true) == driver || get_post_meta($post->ID, 'post-type', true) == download || get_post_meta($post->ID, 'post-type', true) == phone ) { ?>
    	    <?php the_excerpt('Read on...'); ?>
    <?php } else {?><?php  the_excerpt(); ?>
    
    		<?php } ?>
    
    </div>
    	<hr class="hidden" />
        </div>
          <!--/post -->
    
    	<?php endwhile; ?>
    				  		      <!--Google Ad -->
    
      <div class="left">
      <script type="text/javascript"><!--
    google_ad_client = "pub-4139959960483457";
    /* 468x60, created 7/7/09 */
    google_ad_slot = "0502606764";
    google_ad_width = 468;
    google_ad_height = 60;
    //-->
    </script>
    <script type="text/javascript"
    src="https://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    
      </div>
    			  		      <!--/Google Ad -->
    <div class="clear">
    	<div class="navigation">
          <?php if(function_exists('wp_page_numbers')) { wp_page_numbers(); } ?>
        </div>
        </div>
    	  <br />
        <br />
    
        <?php else : ?>
    
    		<h1>Not Found</h1>
    		  <p>Sorry, but there is no latest post under this head.</p>
    	    <?php endif; ?>
            <!--/content -->
    
      </div>
      <?php get_sidebar(); ?>
      <hr class="hidden" />
    </div>
    <?php get_footer(); ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Category, Archive & Tag Templates showing all Posts’ is closed to new replies.