Need help? Check out our Support site, then


Can't get pagination to work properly

  1. 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() ?><br /> <!--SLIDER--><br /> <div id="featured"><br /> <?php<br /> $sticky = get_option( 'sticky_posts' ); // Get all sticky posts<br /> rsort( $sticky ); // Sort the stickies, latest first<br /> $sticky = array_slice( $sticky, 0, 5 ); // Number of stickies to show<br /> query_posts( array( 'post__in' => $sticky, 'caller_get_posts' => 1 ) ); // The query</p> <p> if (have_posts() ) { while ( have_posts() ) : the_post(); ?><br /> <a>"><br /> <div id="post-<?php the_ID() ?>" class="sticky" style="background-image: url('<?php echo wp_get_attachment_url( get_post_thumbnail_id() ) ?>');"><br /> <div class="sticky-title"><br /> <h1><?php the_title(); ?></h1><br /> </div><br /> </div><br /> </a><br /> <?php endwhile;?><br /> <?php } else { echo ""; }?><br /> </div><br /> <!--SLIDER--></p> <p> <div id="content"><br /> <div id="post-head"><h1>Nieuws</h1></div><br /> <?php// if ( have_posts() ) : while ( have_posts() ) : the_post(); ?><br /> <?php query_posts(array('post__not_in' => $sticky )); while (have_posts()) : the_post();?><br /> <div id="post-<?php the_ID() ?>" class="post"><br /> <div class="post-thumb"><br /> <a>"><br /> <div class="post-pic"><br /> <?php if ( has_post_thumbnail() ) { the_post_thumbnail('single-post-thumbnail'); } else { ?><br /> <p>Geen afbeelding beschikbaar</p><br /> <!--<img src="<?php //bloginfo('template_directory'); ?>/images/default.jpg" alt="<?php //the_title(); ?>" />--><br /> <?php } ?><br /> </div><br /> </a><br /> </div><br /> <div class="post-container"><br /> <div class="post-title"><h2><a>" title="<?php the_title() ?>" rel="bookmark"><?php the_title() ?></a></h2></div><br /> <div class="post-content"><br /> <?php the_excerpt(); ?><br /> </div><br /> <div class="post-meta"></p> <ul> <li><img height="17" width="20" src="<?php bloginfo('template_directory'); ?>/images/comment.png" /> <?php comments_popup_link(' 0', ' 1', '% Comments') ?></li> <li><img height="17" width="17" src="<?php bloginfo('template_directory'); ?>/images/tag.png" /> <?php the_category(', '); ?></li> <li><img height="17" width="19" src="<?php bloginfo('template_directory'); ?>/images/calendar.png" /> <a>"><?php the_time('F j, Y'); ?></a></li> </ul> <p> </div><br /> </div><br /> </div><br /> <?php endwhile ?><br /> <div class="navigation"><br /> <div class="navleft"><?php next_posts_link('« Older Posts', '0') ?></div><br /> <div class="navright"><?php previous_posts_link('Newer Posts »', '0') ?></div><br /> </div><br /> </div><!-- #content --></p> <p><?php get_sidebar() ?><br /> <?php get_footer() ?><br />

    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();?>

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

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

    If you don't understand the difference between WordPress.com and WordPress.org, 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.

Topic Closed

This topic has been closed to new replies.

About this Topic