• mavisenshen

    (@mavisenshen)


    Hi,everyone,
    This is my fist time to use wordpress to build a website, i installed the wooecommerce,when i add subcategoies, i hope can display on the category like tree:
    Category1_subcategories(1,2,3)-products
    how can i change it, i seach the solution, someone said can add code, but i have no idea of code knowlege, so is thers anyone can help me, where should i put this code to, thank you very much, waiting ur help.
    <?php
    // if the page visitor views is a category page
    if (is_category())
    {
    $cur_cat = get_query_var(‘cat’);
    if ($cur_cat)
    {
    $new_cats = wp_list_categories(‘echo=false&child_of=’ . $cur_cat . ‘&depth=1&title_li=&&show_count=1&hide_empty=0’);
    echo ‘

      ‘ . $new_cats . ‘

    ‘;
    }
    }
    ?>

  • The topic ‘how to display the subcategories on the category’ is closed to new replies.