Forums

How do I 'linkify' this function? (1 post)

  1. perthmetro
    Member
    Posted 3 weeks ago #

    This piece of code displays the category as text... but I'd like it to display as a link to that category... any help would be greatly appreciated. Thanks. Pete xxx

    <?php
    foreach((get_the_category()) as $childcat) {
    if (cat_is_ancestor_of(40, $childcat)) {
    echo $childcat->cat_name;
    }}
    ?>

Reply

You must log in to post.

About this Topic