• candregg

    (@candregg)


    I’m trying to modify a theme News Block to limit the number of sub categories it uses to make tabs to only the first level below the top category. Currently, it selects ALL sub cats which is messing up the tabs. (See home page https://prostamerika.com/).

    I’ve tried adding a depth parameter to the category array as follows:

    ` * Setup sub-categories to display
    */

    $sub_cats = array();

    // selected sub-cats?
    if (!empty($sub_cats)) {
    $sub_cats = get_categories(array(‘include’ => $sub_cats, ‘hierarchical’ => false, ‘depth’ => 0, ‘taxonomy’ => (!empty($_taxonomy) ? $_taxonomy : ‘category’)));
    } `

    but it’s not working. The theme support has been slow to help, so I hoped someone here could at least tell me if my code is messed up.

    Any help would be appreciated.

    Thx.

  • The topic ‘Modify block to limit category depth’ is closed to new replies.