Forums

[resolved] How can I remove "counts" from Categories? (3 posts)

  1. JG99
    Member
    Posted 2 years ago #

    Hello, I want to remove the category "count" numbers in parentheses when my categories are listed. I understand the 0 and 1 values more or less, but looking at the code below it seems my theme is a little more complicated than simply changing the 1 to a 0. I tried doing that and it had no effect at all. Can anyone help? THANK YOU.
    ----------------------------------------------------

    <?php
    }

    function widget_mytheme_categories($args) {
    extract($args);
    $options = get_option('widget_categories');
    $c = $options['count'] ? '1' : '0';
    $h = $options['hierarchical'] ? '1' : '0';
    $title = empty($options['title']) ? __('Categories') : $options['title'];
    ?>

  2. <h2><?php echo $title; ?></h2>
      <?php wp_list_cats('sort_column=name&optioncount=$c&hierarchical=$h'); ?>
  3. <?php

  • MichaelH
    Volunteer
    Posted 2 years ago #

    It would seem that is a widget that has an option to suppress the count.

    But you might consider using the template tag, wp_list_categories():

    <?php wp_list_categories('title_li='); ?>

    Note that wp_list_cats is deprecated.

  • JG99
    Member
    Posted 2 years ago #

    MichaelH = GENIUS

    THANK YOU, SIR !!

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags