next_posts_link, prev_posts_link not showing
-
My site is 49doors.com
I have a template for Category Index page, where the page will load all posts under a specific category. For example:
Category Index exampleAnother template for Category Archive shows similar results:
Archive exampleI am able to have the next_posts_link and prev_posts_link show up on the Archive page, but not on the Category Index page.
This is what the code looks like for the Category Index:
<?php /* Template Name: Category Index */ get_header(); $pieces = explode("/", $_SERVER["REQUEST_URI"]); array_pop($pieces); $page_name = array_pop($pieces); $idObj = get_category_by_slug( $page_name ); $thisCat = get_category( $idObj->term_id ); ?> <div id="leftcontent"> <div class="page-title" id="cat-index"><?php echo $thisCat->cat_name; ?></div> <!-- CMZ disable div class="contentheader"></div--> <?php global $more; $args = array( 'category' => $idObj->term_id, 'orderby' => 'post_date', 'order' => 'DESC', 'numberposts' => 10, 'paged' => $paged, ); $myposts = get_posts( $args ); $nr = 1; foreach( $myposts as $post ) : setup_postdata($post); $more = 0; $custom = get_post_custom_values("featured_image"); $category = get_the_category(); $image = catch_that_image(); $replace = 'images/posts/cropped'; $cropped = preg_replace( '/images\/posts/', $replace, $image); ?> <a href="<?php the_permalink(); ?>"><div class="excerpt-box2"> <div class="content" > <div class="pic-frame"> <?php if ( has_post_thumbnail() ) { ?> <div class="pic"><?php echo get_the_post_thumbnail();?></div> <?php } else { ?> <div class="pic" style="background-image:url(<?php echo $cropped ?>);background-size:cover;" ></div> <?php } ?> </div> <div class="post-meta"> <span class="date"><?php the_time('l, F jS, Y') ?> /</span> <?php comments_popup_link('No Comments', '1 Comment', '% Comments', 'comments-link', ''); ?> </div> <div class="excerpt"><?php the_excerpt(); ?></div> <div class="square-sel"></div> <div class="cat-label"><?php echo $category[0]->cat_name; ?></div> <div class="title-banner"> <a href="<?php the_permalink(); ?>"><div class="post-title"><?php get_the_category( ) ?><?php the_title(); ?></div></a> </div> <!-- CMZ disable div class="feedback-widget"> <div class="comments"><?php comments_number( '', '1', '%' ); ?></div> </div --><!--end .feedback-widget--> </div><!--end .content--> </div><!--end .excerpt-box2--></a> <?php $nr++; endforeach; ?> <!--this is for the Older/Newer post navigation--> <?php include (TEMPLATEPATH . '/inc/nav.php' ); ?> </div><!--end leftcontent--> <?php get_sidebar(); ?> <?php get_footer(); ?>
This code snippet is also used for the Archive page and works well:
<?php include (TEMPLATEPATH . '/inc/nav.php' ); ?>
points to:
<div class="navigation"> <div class="next-posts"><?php next_posts_link('« Older Posts' ) ?></div> <div class="prev-posts"><?php previous_posts_link('Newer Posts »' ) ?></div> </div>
Please any suggestions would be helpful – thank you.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘next_posts_link, prev_posts_link not showing’ is closed to new replies.