I just created a loop-event.php template for a custom post type. But the pagination is not working at all.
I was trying different recipes from: http://wordpress.stackexchange.com/search?q=custom+post+type+pagination But nothing is working for me.
Thanks in advance.
<?php
$args = array();
$args['post_type'] = 'event';
query_posts($args);
?>
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<div id="nav-above" class="navigation">
<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div>
<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div>
</div><!-- #nav-above -->
<?php endif; ?>
<?php while ( have_posts() ) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<div class="entry-meta">
<?php the_time('1, jS F Y'); ?> | <?php the_terms( $post->ID, 'activity', ' ', ', ', ' ' ); ?>
</div><!-- .entry-meta -->
<div class="entry-content">
<?php
if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
the_post_thumbnail('thumbnail', array('class' => 'alignright'));
}
?>
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?>
<div class="entry-meta"><?php the_terms( $post->ID, 'country', ' ', ', ', ' ' ); ?></div>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<div class="entry-utility">
<?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
</div><!-- .entry-utility -->
</div><!-- #post-## -->
<?php endwhile; ?>
loop-event.phpin your question, how does this relate to a page? – t31os Mar 9 '11 at 19:39lopp-event.phpis not a file you can expct to run for a page... are you using a named template(ie. a file you attach to page) or something else(a native template)... – t31os Mar 9 '11 at 22:44