Support » Fixing WordPress » Show empty categories woocommerce

  • I want to show my empty categories, but i need to change the code..

    i got this code from someones .

    add_filter(‘woocommerce_product_categories_widget_args’, ‘woocommerce_show_empty_categories’);
    function woocommerce_show_empty_categories($cat_args){
    $cat_args[‘hide_empty’]=0;
    return $cat_args;
    }

    But where do i place it in my function.php

    (Moderated. To post large amounts of code use pastebin.com) https://codex.wordpress.org/Forum_Welcome#Posting_Large_Excerpt_of_Code

Viewing 2 replies - 1 through 2 (of 2 total)
  • kooor

    (@kooor)

    Hi,
    If you are using “woocommerce product categories” widget, then there is option to hide or display empty categories. But if you display product categories using short code, then change the value of parameter-hide_empty to 1 in the the short code like this –[product_categories number="4" hide_empty="0" parent ="0"]. The default value for hide_empty is 1.
    Refer this Product categories

    Though its quite late to answer, but perhaps someone else benefits.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show empty categories woocommerce’ is closed to new replies.