• I put the following code to display under the parent category. But there is no link to the subcategory.
    Please help me how to change if the subcategories have links

    <?php
    $cat = get_category( get_query_var( 'cat' ) );
    $cat_id = $cat->cat_ID;
    $child_categories=get_categories(
        array( 'parent' => $cat_id )
    );
    foreach ( $child_categories as $child ) {
        // Here I'm showing as a list...
        echo '<li>'.$child ->cat_name.'</li>';
    }
    • This topic was modified 2 years, 8 months ago by t-p. Reason: Moved to Fixing WordPtress from Developing with WordPress
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘View with subcategory link’ is closed to new replies.