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">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
        <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</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">&rarr;</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; ?>
link|improve this question

You shouldn't even need the args and query posts lines, if this is the loop for your event type the applicable args should be set for you already. – t31os Mar 9 '11 at 18:35
Im using wp 3.0.5 and if I comment that lines then only the page is displayed, take a look: acicafoc.josoroma.com/publicaciones Thanks. – José Pablo Orozco Marín Mar 9 '11 at 18:45
You mentioned the loop-event.php in your question, how does this relate to a page? – t31os Mar 9 '11 at 19:39
In backend, when I created the page publicaciones i choose publications as template. Im doing something wrong? – José Pablo Orozco Marín Mar 9 '11 at 21:25
I follow you, but lopp-event.php is 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
feedback

closed as not a real question by toscho May 1 at 21:19

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. See the FAQ for guidance on how to improve it.

Browse other questions tagged or ask your own question.