Forums

Taxonomy Images
Only show three images (4 posts)

  1. andhy1272
    Member
    Posted 1 year ago #

    I'm using custom taxonomies, please look this code:
    <?php
    $country = get_terms('countries');
    foreach($country as $c)
    {
    echo $taxonomy_images_plugin->get_image_html('medium', $c->term_id);
    }?>

    This code show me the first three images and then stop to do it.
    It could be because is a beta version?

    Thanks for your time and Regards.

  2. Michael Fields
    Theme Wrangler
    Posted 1 year ago #

    How many total countries do you have? How many of these functions have images associated with them? I believe that $taxonomy_images_plugin->get_image_html() will only return a value if the term has an associate image.

  3. andhy1272
    Member
    Posted 1 year ago #

    Hi Michael
    Thanks for your response, please let me explain the situation:
    I created a "custom post type" called "Organizations", then I added a new taxonomy called "Countries". Next, I installed your plugin, I created some countries and place an image on them. Check here

    Please look this image, it content the code that I'm using to show the images: code

    But this only show me the three first images that I set. Look

    Thanks for your time, I really appreciate your help.
    Regards.

  4. Diogo15
    Member
    Posted 1 year ago #

    If dont have any post inside your terms taxonomy, the images wont show,...

    $args = array( 'hide_empty' => 0);
    $xxx = get_terms('xxx', $args);

    If you would like to see it..

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic