• Hi All: I can get the query to work for all posts or limit the posts per page but for some reason when I add the $paged code I can only get all posts. I cannot figure what I am doing wrong.

    Code snippet:

    <div class="postarea">
       			 <ul>
    			 <h2>In The News</h2>
    			    <?php  $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;  ?>
                   	<?php query_posts('category_name=News&posts_per_page=4' . $paged);?>
                    <?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?>
                    <div>
        			  <li><p><h3><?php echo get_post_meta($post->ID, 'publication', $single=true) ?> : <a href='<?php echo get_post_meta($post->ID, 'Link', $single=true) ?>' rel="bookmark" title='Permanent Link to <?php the_title_attribute(); ?>'><?php the_title(); ?></a></h3></p>
        			  <span class="date"><?php the_time('M d, Y'); ?></span> -  <?php echo get_post_meta($post->ID, 'Summary', $single=true) ?></li>
                    </div>
        			 <?php endwhile; else: ?>
    				 <div class="navigation">
    					<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    					<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    				</div>
    
                    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
            		<?php endif; ?>
    				</ul>
    		</div>

    Thanks!

Viewing 1 replies (of 1 total)
  • Thread Starter bridgemanusa

    (@bridgemanusa)

    Can anyone please tell me what I am doing wrong here? To me it looks like it should all work. Thanks in advance.

Viewing 1 replies (of 1 total)
  • The topic ‘Results of custom query not paginating – get all posts’ is closed to new replies.