• i use this code to show child categories of parent with id=12,ok, It show. But hoe can I do to go to a page with subcategories choose with its all option, and wehn click one of them, goes to the post single page? How can I change this code to do this

    <?php
    foreach((get_the_category()) as $childcat) {
    if (cat_is_ancestor_of(12, $childcat)) {
    echo '<a href="'.get_category_link($childcat->cat_ID).'">';
     echo $childcat->cat_name . '</a>';
    }}
    ?></h3>
    		        <?php
    foreach((get_the_category()) as $childcat) {
    if (cat_is_ancestor_of(icl_object_id(12, 'category', false), $childcat)) {
    echo '<div id="thumb-category"><a href="'.get_category_link($childcat->cat_ID).'">';
     echo do_shortcode('[types field="imagem-1" alt='.($childcat->cat_ID).' title="'.get_category_link($childcat->cat_ID).'" size="thumbnail" align="none"]') . '</a><div>';
    }}
    ?>
  • The topic ‘child categories page’ is closed to new replies.