Static start page template, wp_query, pagination
-
Hey guys
I’m pretty stuck. I’m working on a wordpress site, that uses a static start page template. I use wp-query to display excerpts from two categories on this page. It all works fine, however I somehow don’t manage to add pagination. Right now, it displays all excerpts (or the number i’d like it to display). What I’d like to be able to do, is the start page to show a certain number of excerpts and the remaining ones on additional pages. I’m still pretty new to WP, and I’ve also tried several suggestions mentioned here in the forum, however, even if I get pagination to show up, all additional pages show the same excerpts…
Here’s the code as of now:
<?php $my_query = new WP_Query('cat=1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20&showposts=15'); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; if (in_category('Blog')) { ?> <div class="hentry_start"> <p class="hentry_date_start"><?php the_time('d. F Y'); ?></p> <img src="<?php echo get_stylesheet_directory_uri(); ?>/images/navigation/excerpt-line.gif" height="1" width="285" /> <div class="excerpt_headline"> <a <?php post_class(); ?> href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </div> <div class="excerpt_subline"> <?php if (function_exists('the_subheading')) { the_subheading('<p>', '</p>'); } ?> </div> <?php the_post_thumbnail(); ?> <?php the_content(); ?> </div> <?php } elseif (in_category('Publication')) { ?> <div class="hentry_start"> <p class="hentry_date_start"><?php the_time('d. F Y'); ?></p> <img src="<?php echo get_stylesheet_directory_uri(); ?>/images/navigation/excerpt-line.gif" height="1" width="285" /> <div class="excerpt_headline"> <a <?php post_class(); ?> href="<?php the_field('download'); ?>"><?php the_title(); ?></a> </div> <div class="excerpt_subline"> <p><?php the_field('titel'); ?> | <?php the_field('stars'); ?> | <?php the_field('coauthor'); ?></p> </div> <?php the_post_thumbnail(); ?> <p><?php echo custom_field_excerpt(); ?></p> <a class="btn_download_publicationen" href="<?php the_field('download'); ?>"></a> </div> <?php } ?> <?php endwhile; ?> <?php if (have_posts()) : while (have_posts()) : the_post(); if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?> <?php endwhile; endif; ?>
Any help is appreciated ??
- The topic ‘Static start page template, wp_query, pagination’ is closed to new replies.