WordPress.org

Ready to get started?Download WordPress

Forums

Taxonomy Images
Issue with displaying categories only from top level (2 posts)

  1. JoostJoost
    Member
    Posted 1 year ago #

    Hello,

    I try to show only the top level categories. This is my current code:

    <?php
    $terms = apply_filters( 'taxonomy-images-get-terms', '', array('depth'=>1) );
    if ( ! empty( $terms ) ) {
    
        print '<ul class="categoriewrap">';
        foreach( (array) $terms as $term ) {
            print '<li class="categorie"><a href="' . esc_url( get_term_link( $term, $term->taxonomy ) ) . '">' . wp_get_attachment_image( $term->image_id, 'category' ) .  '</a></li>';
        }
        print '</ul>';
    }
    ?>

    what am I doing wrong in this case?

    Joost

    http://wordpress.org/extend/plugins/taxonomy-images/

  2. JoostJoost
    Member
    Posted 1 year ago #

    Anyone got an idea? Thanks in advance! :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic