Can't get pagination to work properly

  • Author
  • #1105653


    i am currently using 2 loops on my custom theme,
    what i want to achieve is to have my sticky posts presented on a content slider, while my regular posts apearr normaly. So far i have achieved that but my problem is now that i want to add pagination to it, it eather won’t appear or i go to the next page (page 2) with the exact same blog posts so basicly only the url has changed :s
    this is my code so far

    <?php get_header() ?>
    <div id="featured">
    $sticky = get_option( 'sticky_posts' ); // Get all sticky posts
    rsort( $sticky ); // Sort the stickies, latest first
    $sticky = array_slice( $sticky, 0, 5 ); // Number of stickies to show
    query_posts( array( 'post__in' => $sticky, 'caller_get_posts' => 1 ) ); // The query

    if (have_posts() ) { while ( have_posts() ) : the_post(); ?>
    <div id="post-<?php the_ID() ?>" class="sticky" style="background-image: url('<?php echo wp_get_attachment_url( get_post_thumbnail_id() ) ?>');">
    <div class="sticky-title">
    <h1><?php the_title(); ?></h1>

    <?php endwhile;?>
    <?php } else { echo ""; }?>

    <div id="content">
    <div id="post-head"><h1>Nieuws</h1></div>
    <?php// if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <?php query_posts(array('post__not_in' => $sticky )); while (have_posts()) : the_post();?>
    <div id="post-<?php the_ID() ?>" class="post">
    <div class="post-thumb">
    <div class="post-pic">
    <?php if ( has_post_thumbnail() ) { the_post_thumbnail('single-post-thumbnail'); } else { ?>
    <p>Geen afbeelding beschikbaar</p>
    <!--<img src="<?php //bloginfo('template_directory'); ?>/images/default.jpg" alt="<?php //the_title(); ?>" />-->
    <?php } ?>

    <div class="post-container">
    <div class="post-title"><h2>" title="<?php the_title() ?>" rel="bookmark"><?php the_title() ?></h2></div>
    <div class="post-content">
    <?php the_excerpt(); ?>
    <div class="post-meta">

    • <img height="17" width="20" src="<?php bloginfo('template_directory'); ?>/images/comment.png" /> <?php comments_popup_link(' 0', ' 1', '% Comments') ?>
    • <img height="17" width="17" src="<?php bloginfo('template_directory'); ?>/images/tag.png" /> <?php the_category(', '); ?>
    • <img height="17" width="19" src="<?php bloginfo('template_directory'); ?>/images/calendar.png" /> "><?php the_time('F j, Y'); ?>

    <?php endwhile ?>
    <div class="navigation">
    <div class="navleft"><?php next_posts_link('« Older Posts', '0') ?></div>
    <div class="navright"><?php previous_posts_link('Newer Posts »', '0') ?></div>
    </div><!-- #content -->

    <?php get_sidebar() ?>
    <?php get_footer() ?>

    I guess the problem must lie some where in this piece of code
    <?php query_posts(array('post__not_in' => $sticky )); while (have_posts()) : the_post();?>



    You did not specify a blog address or reason for posting when you created this topic.

    This support forum is for blogs hosted at If your question is about a self-hosted WordPress blog then you’ll find help at the forums.

    If you don’t understand the difference between and, you may find this information helpful.

    If you forgot to include a link to your blog, you can reply and include it below. It’ll help people to answer your question.

    This is an automated message.

The topic ‘Can't get pagination to work properly’ is closed to new replies.