WordPress.org

Ready to get started?Download WordPress

Forums

Taxonomy Images
Displaying on the home page or in Widgets (4 posts)

  1. rfair404
    Member
    Posted 2 years ago #

    Hello your plug-in looks promising, good job. I'm considering using it for a project that requires a taxonomy term based navigation that supports images be part of the sidebar on most pages as well as a slider of taxonomy terms on the home page. I can handle marking it up, what I was hoping to find was the image handling piece. Is your plugin only able to display images on a category.php or archive.php page or can it be made to work on a non-archive type of page like page.php? If so perhaps I have missed it in your documentation? could you point me in the right direction?

  2. Michael Fields
    Themer
    Plugin Author

    Posted 2 years ago #

    There is a filter built-in that funtions very closely to get_terms(). I would suggest starting there.

  3. rfair404
    Member
    Posted 2 years ago #

    This is what I wound up using. It works for what I needed. Hopefully it helps someone else. I wound up adding a jquery cycle function to these to make a nice little Term Slider.

    `$terms = apply_filters( 'taxonomy-images-get-terms', '', array('taxonomy'=>'product_categories') );

    if ( ! empty( $terms ) ) {
    echo '<div id="slider-wrap"><div id="slider-r">';
    foreach( (array) $terms as $term ) {
    echo '<div class="product_category_item"><div class="imageunder">taxonomy ) ) . '">' . wp_get_attachment_image( $term->image_id, 'taxonomy-image' ) . '</div><div class="textover">taxonomy ) ) . '"><h1>'.$term->name.'</h1><p>' . $term->description . '</p></div></div>';
    }
    echo '</div><div class="slider-nav"><ul class="nav-thumbs">';
    foreach( (array) $terms as $term ) {
    echo '<li class="thumb-item">' . wp_get_attachment_image( $term->image_id, 'taxonomy-thumb' ) . '';
    }
    echo '';
    echo '</div></div>';
    }'

  4. Carrie Dils
    Member
    Posted 2 years ago #

    I am also looking for a way to utilize the plugin outside the loop (in my case to call a single category image in a widget).

    Could you go into a little more detail on the filter suggested above (similar to get_terms)? I'm trying to follow along with the logic, but my php is still in learning curve mode.

    Many thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic