• uteman23

    (@uteman23)


    Hey everyone,
    I have been through several blog entries and forum topics and can’t find what I need. I have a “gallery” page that I am pulling post info into via the query_posts() function. I need it to paginate after the page has 6 posts. No url yet, here is my code:

    ‘<?php query_posts(‘category_name=hats&showposts=6’); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class=”thumb”>
    <?php
    $attachments = get_children( array(‘post_parent’ => get_the_ID(),
    ‘post_type’ => ‘attachment’,
    ‘numberposts’ => 1, // show all -1
    ‘post_status’ => ‘inherit’,
    ‘post_mime_type’ => ‘image’,
    ‘order’ => ‘ASC’,
    ‘orderby’ => ‘menu_order ASC’
    ) );

    if($attachments)
    {foreach ( $attachments as $attachment_id => $attachment ) {?>
    “><?php echo wp_get_attachment_image( $attachment_id, ‘thumbnail’ );?>
    <?php }}?>
    <div class=”thumbtext”><?php the_title(); ?></div>
    <div class=”price”><?php $price = get_post_meta($post->ID, ‘price’, true); ?><?php echo $price; ?> USD</div>
    </div>
    <?php endwhile; endif; ?>’

  • The topic ‘Pagination on a page’ is closed to new replies.