Output Number Of Posts In Category
-
Ok, so I know the subject of the title is pretty easy to output with wp_list_categories, but im trying to output it a little differently.
I would like to display the count for a category + the name of the post title it is currently within.
eg, there is a post and a category called ‘Awesome Stuff’
And there is a sub-category called Photos with the Slug of ‘photos-awesome-stuff’So the code would need to display something along the lines of:
<?php wp-list-categories(‘category=photos-‘.the_title.; ?>Hope the above makes a little sense. Ive pasted below what is currently in use and not working:
<?php query_posts( 'cat=45&posts_per_page=4' ); while ( have_posts() ) : the_post() ?> <div id="post-<?php the_ID() ?>" class="post model_grid"> <a href="<?php the_permalink() ?>"><?php if ( has_post_thumbnail() ) { the_post_thumbnail( ); } ?></a> <div class="model_name"> <?php the_title(); ?><br /> Photos: <?php echo wt_get_category_count('photos-'.the_title('','',false).); ?> </div> </div><!-- .post --> <?php endwhile ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Output Number Of Posts In Category’ is closed to new replies.