How to Unhide Empty Categories?

This topic contains 5 replies, has 3 voices, and was last updated by  Stiofan O’Connor 6 years, 8 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #391057

    Matthew Milner
    Expired Member
    Post count: 5

    Can anyone advise on how to unhide empty categories from the search widget?

    In an effort to encourage users to add listings I want it be obvious which categories we cover.

    #391079

    Kor
    Moderator
    Post count: 16516

    Hi Matthew,

    Unfortunately, there isn’t a way to achieve this. Categories will only be displayed when there are listings in it and would require customization to achieve what you needed there. Have you considered inserting sample listings in order to force it to display?

    Thanks!

    #391103

    Matthew Milner
    Expired Member
    Post count: 5

    Hi,

    I’m surprise to hear this, I have seen a few requests for this functionality in my search for a solution….and even some old posts alluding to a “Hide empty categories” tick box that needs to be unchecked (which I couldn’t find) in the admin.

    Also some .php code that seems to refer to this function, but my coding skills are pretty limited.

    #391113

    Matthew Milner
    Expired Member
    Post count: 5

    Some sites suggest using this code

    <?php
    add_filter( ‘widget_categories_args’, ‘force_widget_cat_args’ );
    function force_widget_cat_args($cat_args) {
    $cat_args[‘hide_empty’] = 0;
    return $cat_args;
    }
    ?>

    but I have tried inserting it into a few different function.php files without any success.

    #391118

    Kor
    Moderator
    Post count: 16516

    Hi Matthew,

    I’ll transfer this to a developer for a second opinion.

    Thanks!

    #391166

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    I would suggest making a coming soon listing and assigning it to all ur empty categories, i did that when i was starting a site.

    Thanks,

    Stiofan

Viewing 6 posts - 1 through 6 (of 6 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket