Support » Plugin: WPCustom Category Image » Not Working for Tags

  • Resolved jenniferheller

    (@jenniferheller)


    Hi,

    This is working great for categories, but nothing is showing up for tags…

    Using code:
    $category_image = category_image_src( array( ‘size’ => ‘full’ ) , false );

    In archive.php (there is no category.php or tag.php in this theme).

    Please advise on correct code to load image on tag archive.

    Thanks,
    Jennifer

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Eduardo Stuart

    (@pyro3x)

    Hi Jennifer,

    This plugin works with Tags. You can use the following code:

    $term      = get_queried_object();
    $shortcode = sprintf('[wp_custom_image_category onlysrc="false" size="full" term_id="%s"]', $term->term_id);
    $url       = do_shortcode($shortcode);
    
    printf('<img src="%s" />', $url);

    🙂

    Plugin Author Eduardo Stuart

    (@pyro3x)

    Jennifer,

    I just updated the plugin with a small fix.

    Please download the new version 🙂

    Thread Starter jenniferheller

    (@jenniferheller)

    Thank you!! Works great now!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Not Working for Tags’ is closed to new replies.