Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter sukient

    (@sukient)

    Thank you alchymyth,

    I managed to make it work as I wanted. Thank you again. Here is the code that works.

    <?php
    $parentCatName = single_cat_title(”,false);
    $parentCatID = get_cat_ID($parentCatName);
    $childCats = get_categories( ‘child_of=’.$parentCatID );
    if(is_array($childCats)):
    foreach($childCats as $child){ ?>
    <h2><?php echo $child->name; ?></h2>
    <?php query_posts(‘cat=’.$child->term_id);
    while(have_posts()): the_post(); $do_not_duplicate = $post->ID; ?>
    <!– POST CODE –>

    <!– END POST CODE –>
    <?php
    endwhile;
    wp_reset_query();
    }
    endif;
    ?>

    Thanks again for helping me.

    Best Regards,
    Julian

    Thread Starter sukient

    (@sukient)

    thanks chinmoy29, logical it should work like this. No when I implement it in the category page I get the following error:

    Parse error: syntax error, unexpected T_DOUBLE_ARROW in /***/***/public_html/***/wp-content/themes/k2/category.php on line 11

    and on line 11 is the following code:\

    $childCats = get_categories( ‘child_of’ => $parentCatID );

Viewing 2 replies - 1 through 2 (of 2 total)