0

I'm using the code from here to split my loop up in to columns. The columns work. I have 7 posts in the databese and showposts set to 6. I cannot get nextpage link to show? I have a $paged variable in my $args array I have set number of posts per page to 5 in admin/reading. Full loop below. Many thanks in advance.

<?php 
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'showposts' => 6,
'&paged=' => $paged,
'tax_query' => array(
    array( 'taxonomy' => 'post_format',
        'field' => 'slug',
        'terms' => array('post-format-audio')

        )
    )
);
$the_query = new WP_Query($args);?>
<?php foreach(new WP_Query_Columns($the_query, 3) as $column_count) : ?>
    <ul class="sc-track-list fourteen columns alpha">
        <?php while ($column_count--) : $the_query->the_post(); ?>
        <li class="sc-track">
            <div class="sc-player">
                     <h1 class="entry-title"><a href="<?php echo get_post_meta($post->ID, '_format_audio_embed' , true); ?>"></a></h1><!--title-->
                     </div>
        <div class="meta"> 
            <span class="entry-date"><?php echo get_the_date(); ?></span> 
            <a class="spch-bub-inside" href="<?php comments_link(); ?>">
                <span class="point"></span>  
                <em><?php comments_number('0', '1', '%'); ?></em>
            </a>                               
            <span class="entry-tag"><?php the_tags(' '); ?></span>                 

            <script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
           <a href="http://twitter.com/share" class="twitter-share-button"
              data-url="<?php the_permalink(); ?>"
              data-via="jillowen"
              data-text="<?php the_title(); ?>"
              data-count="horizontal">Tweet</a>
              </div>

        </li>


        <?php endwhile; ?>


    </ul>



<?php endforeach; ?>

<div class="navigation">
<div class="alignleft"><?php previous_posts_link('&laquo; Previous Entries') ?></div>
<div class="alignright"><?php next_posts_link('&laquo; Older Entries') ?>
</div>


</div>

1 Answer 1

1

You're not using the Loop. You should also use get_posts instead.

1
  • Hi thanks for your advice. I'm using foreach as apposed to the loop.
    – James
    Commented Jan 28, 2012 at 13:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.