• Hi all,

    I am trying to limit my posts displayed to 6, the theme splits the posts into 2 coloums, the original code is:

    <?php if (have_posts()):?>
    			<ul>
    			<?php
    			$x = 0;
    			while (have_posts()) : the_post(); update_post_caches($posts);
    			$x++;
    			?>
    				<li<?php if ($x % 2) { } else { echo ' class="right_col"';} ?>>
    					<?php unset($img);
    						if ( current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail() ) {
    						$thumbURL = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), '' );
    						$img = $thumbURL[0];  }
    						else {
    							unset($img);
    							if ($wpzoom_cf_use == 'Yes')  { $img = get_post_meta($post->ID, $wpzoom_cf_photo, true); }
    						else {
    							if (!$img)  {  $img = catch_that_image($post->ID);  } }
    						}
    						if ($img) { $img = wpzoom_wpmu($img); ?>
    						<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo $img ?>&w=75&h=75&zc=1" alt="<?php the_title(); ?>" /></a><?php } ?>
    					<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a><span class="comm_bubble"><?php comments_popup_link('0', '1', '%', ' ', ' '); ?></span>
    					<span class="meta"><?php the_time("$dateformat $timeformat"); ?> <?php edit_post_link( __('Edit', 'wpzoom'), ' ', ''); ?></span>
    					<?php wpe_excerpt('excerpt_tabs', 'wpe_excerptmore'); ?>
    
    				</li><?php endwhile; ?>
    
    			</ul><?php endif; ?>

    If I add

    <?php query_posts('showposts=6'); ?>

    before <?php if (have_posts()):?>

    Then it will display 6 posts, but repeat them 4 times 🙁

    Anyone help me with this?

    Cheers

  • The topic ‘Help with limit post’ is closed to new replies.