• Hi all

    I’ve two questions which hopefully someone can advise on… The first
    I’ve the following code on my page, which shows the SUB Category of Parent33 which works fine, however it automatically makes it a link and uses LI which I don’t want. How can I make it show text only?

    <?php
    if (is_home()) {
    wp_list_categories('orderby=id&title_li=&depth=1');
    }
    else{
    $category = get_the_category();
    $cat_term_id = $category[0]->term_id;
    $cat_category_parent = $category[0]->category_parent;
    $listcat = wp_list_categories('echo=0&child_of=33&title_li=');
    $listcat = str_replace("cat-item-".$cat_term_id, "cat-item-".$cat_term_id." current-cat", $listcat);
    if ( in_category( $cat_term_id ) || post_is_in_descendant_category( $cat_term_id )) {
    echo $listcat;
    }
    }
    ?>

    The second issue is that I’ve categories 2 children deep (if thats he correct wording) as follows;
    – England
    – South
    – West Sussex
    – London
    – Cornwall
    I want to produce only at “County” level (West Sussex, London etc). If I use the code above I get “South” & “London”. How can I extract the very last level only, again without it being a link?

    I’ve no hair left to rip out ??

    Thanks in advance.

  • The topic ‘Show Unlinked Child Only’ is closed to new replies.