Support » Fixing WordPress » Number of Posts in Category

  • Resolved Inspired2Write

    (@inspired2write)


    Hi,
    I thought there was an option to do this within the dashboard, but I don’t find any settings there.

    Currently next to each of my category names in my sidebar it displays the total number of posts within each of them. If I did not want the number to display, but just the category name to display, is there a hack for this? If so, what is the hack and where would I place it? Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • http://codex.wordpress.org/Template_Tags/wp_list_cats

    from the codex page on wp_list_cats:

    <?php wp_list_cats('arguments'); ?>

    if you dont want to show how many posts, remove the optioncount part.

    Its up to the theme writer how they decide to list catergories, and up to you, the user, to change it, if you dont like how they implemented it. Assuming its being displaying in your sidebar, the relevant code to edit will be inside your current theme’s sidebar.php

    IF you dont have a sidebar.php or something like that, look inside your current theme’s index.php

    Hi,

    I’m not certain how to change the code. Here is what my sidebar php category code looks like (without the backticks).

  • <h2><?php _e(‘Categories’); ?></h2>
    • <?php list_cats(0, ”, ‘name’, ‘asc’, ”, 1, 0, 1, 1, 1, 1, 0,”,”,”,”,”) ?>

Info on list_cats():

http://codex.wordpress.org/Template_Tags/list_cats

Modify yours to:

<?php list_cats(0, '', 'name', 'asc', '', 1, 0, 0, 1, 1, 1, 0,'','','','',''); ?>

Hi Kafkaesqui,

That code did the trick perfectly! It cleaned up the appearance of my sidebar nicely. Thanks! 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Number of Posts in Category’ is closed to new replies.