• Resolved apratherjr

    (@apratherjr)


    I just completed my custom gallery page… Gallery page will show up to 6 thumbnail per row, Now if I constantly post more gallery, it will goes on and on for entire page. I dont want reader to scroll long down so instead that, I want to be able to limit rows before it can turn into another page. How can I implement code or function for this?

    Just like one where you could set up limit number of blog posts per page inside Admin Setting ← reading.

    or one like (Click on Portfolio from menu, and scroll down until you see page buttons) THIS

    I have looked into some individual codes in THIS FORUM This may look good, but the only problem is, I am not sure I am able to set up # of rows limit per page. Just like codes I have here setting up # of thumbs per row –>

    <?php if ( have_posts() ) : ?>
        <?php $i= 0; ?>
        <?php while ( have_posts() ) : the_post(); $i++; ?>
    
          <!--- Blah Blah codes here --> 
    
      <?php if ($i % 6 == 0) echo '<div style="clear: both;"></div>'?>
        <?php endwhile; ?>
    <?php endif; ?>

    Any suggestions?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The change needs to be made to the query and to the navigation. If you put your code into a pastebin and post a link to it here, someone might be able to help.

    Thread Starter apratherjr

    (@apratherjr)

    Actually, I found solution… I just added

    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    
        $wpbp = new WP_Query(array(
                'post_type' =>  'portfolio',
                'posts_per_page'  =>'18' ,
                'paged'=>$paged
            )
        );

    before the if have_posts, have-posts, the_post thing…Thank you anyway.

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

The topic ‘custom gallery post pagination’ is closed to new replies.