WordPress.org

Ready to get started?Download WordPress

Forums

Need help numbering archive results (2 posts)

  1. shiningpathos
    Member
    Posted 1 year ago #

    I am trying to code a category archive page to look like this -

    http://d.pr/i/LhdC

    The first thing I'm unsure of is how to get the count for the '(3) results' at the top of the page. The code I'm currently using only allows the total count of all posts, rather than just that category -

    <?php $cat = $category->cat_ID; $allsearch = &new WP_Query(array('showposts' => '-1', 'category' => $cat)); $key = wp_specialchars($s, 1); $count = $allsearch->post_count; echo $key; echo $count . ''; wp_reset_query(); ?>

    The second thing is that using an ordered list doesn't let me results as you see them in the mockup. I'm looking for some other post_count code that would let me display the number beside each result. Thanks!

  2. shiningpathos
    Member
    Posted 1 year ago #

    Anyone know how to do this?

Topic Closed

This topic has been closed to new replies.

About this Topic