• Hi,

    I have a problem with the tags on this website:
    http://deidrawilson.com

    It doesn’t matter what tag I want to view, it displays all posts.
    I have a special query that displays only 5 posts per page which I think is the problem, because with the standard loop I don’t get this problem. Can anyone tell me what can I do with it, so it can properly display the tags and also display 5 posts per page ?

    This is the query:

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    		$args= array(
    			'posts_per_page' => 5,
    			'paged' => $paged
    			);
    		query_posts($args); ?>
    		<?php while (have_posts()) : the_post(); ?>
            <div class='blog_post post'>
              <h1><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h1>
              <h2><?php the_time(get_option('date_format')); ?>  -  Posted In:<?php the_tags("",", ",""); ?></h2>
              <?php the_content(); ?>
            </div>
          <?php endwhile;?>
          <div style="text-align:center;">
    	      <?php posts_nav_link(); ?>
    	  </div>

    Thanks,
    Nihilistar

Viewing 3 replies - 1 through 3 (of 3 total)
  • Well if you use something like the Tag Cloud Widget, or the_tags() or wp_tag_cloud() in your theme, then WordPress will present links for your tags. Then when a particular tag is clicked, the Template Hierarchy will be followed and a display of posts in that tag will be presented.

    Now if you want to “customize” the way the posts in a particular tag are displayed then review the Tag Templates article.

    try only change post_per_page in Admin Dashboard > Options > Reading.

    or for me that is work <?php
    <?php
    global $wp_query;
    global $paged;

    query_posts(
    array_merge(array(
    ‘posts_per_page’=>6,
    ‘paged’=>$paged
    ), $wp_query->query)

    );

    ?>

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Tag displays all posts’ is closed to new replies.