• cra2

    (@cra2)


    Hi,
    I was able to unhide the categories with no posts by editing the sidebar.php in the theme.
    But then I disabled the “categories” code that was hard-coded into theme and wish to just use the default “Category” widget that comes with WordPress.
    So, where is the code that controls the Category widget.
    I’d like to add the argument [‘hide_empty=0&] to the front and thus unhide the empty categories just like I was able to on the theme itself.

    thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • MichaelH

    (@michaelh)

    Instead of changing core files, consider downloading and installing Otto’s PHP Code Widget.

    Then put something like this in one of those widgets:

    <?php wp_list_categories('hide_empty=0'); ?>

    Thread Starter cra2

    (@cra2)

    given that a plugin means yet another item to manage/upgrade, wouldn’t it be easier to just put that code into the “widget: category” file? (if I could find it)

    MichaelH

    (@michaelh)

    given that a plugin means yet another item to manage/upgrade

    Sure, but if you modify core, then you would need to manually fix the code everytime you install a WordPress update. I would say the core update will happen more times than the plugin gets updated. And the plugin update is more or less automatic.

    But if you insist, look at wp-includes/default-widgets.php.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Unhide Categories with no Posts ?’ is closed to new replies.