[resolved] Number of Posts in Category (5 posts)

  1. Inspired2Write
    Posted 9 years ago #

    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!

  2. whooami
    Posted 9 years ago #


    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

  3. Inspired2Write
    Posted 9 years ago #


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


  4. <h2><?php _e('Categories'); ?></h2>

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

  • Kafkaesqui

    Posted 9 years ago #

    Info on list_cats():


    Modify yours to:

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

  • Inspired2Write
    Posted 9 years ago #

    Hi Kafkaesqui,

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

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic