I am using the numbering system for my custom post loop (for a portfolio loop). Is there a ay to add the numbers to just that loop using custom post types?
I can’t get the numbers to show up. I made a new post and still nothing. The only way the number shows up is if I manually add in a custom field for ‘incr_number’.
Here is a look at my code:
<?php include ('header-portfolio.php'); ?>
<?php
if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }
elseif ( get_query_var('page') ) { $paged = get_query_var('page'); }
else { $paged = 1; }
$myposts = array(
'post_type' => 'portfolio',
'posts_per_page' => '10',
'orderby' => 'id',
'order' => 'ASC',
'paged'=> $paged
);
query_posts($myposts);
?>
<?php posts_nav_link(' · ', 'previous page', 'next page'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="thumbwrapper">
<div class="portfolio_post">
<h2><a
title="<?php the_title(); ?>"
href="<?php the_permalink() ?>"
rel="bookmark"><?php the_title(); ?><span><?php printf("%02d", get_post_meta($post->ID,'incr_number',true));?></span>
</h2>
<div class="portfolio_thumb">
">
<?php the_post_thumbnail(); ?>
</div>
</div>
</div>
<?php endwhile; endif; ?>
<div class="nav-previous"><?php next_posts_link( __( '« Older' ) ); ?></div>
<div class="nav-next"><?php previous_posts_link( __( 'Newer »' ) ); ?></div>
<?php wp_reset_query(); ?>