• Hello WordPress community.

    was wondering if it is possible to paginate certain wordpress sidebar items

    Like I have a sidebar called “Projects” and I want it to show a list of 12 After 12 It would go into pages or Next / prev buttons.

    Hope you understand is it possible to do?

Viewing 3 replies - 1 through 3 (of 3 total)
  • i’m looking for the same thing and can’t find an answer…

    Me too. Any ninjas around?

    I think I’ve found a solution that actually works for me. It’s not perfect and not paginated, but it does allow linking to older or newer links…

    <?php
    $postIDs = array();
    $pageChildren = get_pages('child_of=' . $post->ID);
    if ( $pageChildren ) {
      foreach ( $pageChildren as $pageChild ) {
        $postIDs[] = $pageChild->ID;
      }
      $paged = (intval(get_query_var('paged'))) ? intval(get_query_var('paged')) : 1;
      $args = array(
        'post_type' => 'page',
        'paged' => $paged,
        'post__in' => $postIDs,
     	'post__not_in'=> array(1768),
        'posts_per_page' => 15
                    );
      query_posts($args);
      if (have_posts()) : while (have_posts()) : the_post(); ?>
    <li><a href="<?php echo get_permalink($post->ID);?>"><?php the_title(); ?></a></li>
    <?php endwhile; ?>
    <?php endif; ?>
    <?php } ?>
    <!-- End Code -->
    </ul>
    <div style="margin:10px 0 0 0; border-top:1px dotted #999;"></div>
    <div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    <div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Pagination Sidebar’ is closed to new replies.