Grow your CSS skills. Land your dream job.

Problem with WP categories

  • # December 1, 2009 at 8:01 am

    I’m new here, so hello everyone!

    Building small e-shop for a client of mine. Using WordPress 2.8.6 as CMS with plugins eShop, Magic Fields and Just One Category. Categories are mine navigation and here is the problem: I can’t make them collapsable. Using code in my sidebar:

    Code:
    < ?php

    if(is_single()) {
    $categories = get_the_category($_GET['p']);
    foreach($categories AS $subcat) {
    if($subcat -> category_parent != 12) $mycat = $subcat -> category_parent;
    }
    } else {
    $categories = get_the_category();
    foreach($categories AS $subcat) {
    if($subcat -> category_parent != 12) $mycat = $subcat -> category_parent;
    }
    if(empty($mycat)) $mycat = $_GET['cat'];
    }

    if(get_category_children(intval($mycat)) != “”) $submenu[$mycat] = “

      ” . wp_list_categories(‘echo=0&title_li=&showcount=1&use_desc_for_title=0&child_of=’ . intval($mycat)) . “

    “;

    ?>

    Here you can see the code in action: http://www.varkentin.eu/digistep

    For example if I click ARVUTID (left-top) and after it choose any product from right the submenu disapears. Can anybody please tell me what is wrong with my code? There is no problem if I click any sub categories. Thanks. :)

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".