Custom Post Type Archive Page – Pagination Isn't Working
-
I created a custom post type and have displayed them on a custom archive page. I tried adding pagination but the pagination does not show up. Somehow the links are blank. When I preview the source code in the browser via Firebug, it shows the surrounding navigation div, but the individual post link divs are “grayed out.” Somehow the post links are not registering. My custom archive page code is below. Note: I’m using the Genesis framework.
<?php /* Template Name: Press-Posts */ remove_action('genesis_loop', 'genesis_do_loop');//remove genesis loop remove_action('genesis_sidebar', 'genesis_do_sidebar'); remove_action('genesis_sidebar_alt', 'genesis_do_sidebar_alt'); remove_action('get_header', 'ss_sidebars_init'); add_action('genesis_sidebar', 'include_press_sidebar'); add_action('genesis_loop', 'press_loop');//add the press loop function press_loop() { $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $loop = new WP_Query( array( 'post_type' => 'press_post', 'posts_per_page' => 10, 'paged'=>$paged ) ); ?> <h1><?php the_title(); ?></h1> <div id="press-post"> <?php while ( $loop->have_posts() ) : $loop->the_post(); ?> <div id="post-<?php the_ID(); ?>" class="press"> <h2><?php the_title(); ?></h2> <h3><?php echo genesis_get_custom_field('press-date', true ); ?></h3> <?php genesis_post_content(); ?> <?php $pressarticlelink = genesis_get_custom_field('press-article-link', true ); if ($pressarticlelink) { ?> <a class="page-more-link" href="<?php echo $pressarticlelink; ?>" title="Press Article Permalink"><?php echo genesis_get_custom_field('press-link-text', true ); ?></a> <?php } else { ?> <! -- Displays blank --> <?php } ?> </div> <?php endwhile;?> </div><!--end #press-post --> <div class="navigation"> <div class="alignleft"><?php next_posts_link('Previous Entries'); ?></div> <div class="alignright"><?php previous_posts_link('Next Entries'); ?></div> </div> <?php } genesis();
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Custom Post Type Archive Page – Pagination Isn't Working’ is closed to new replies.