WordPress.org

Ready to get started?Download WordPress

Forums

Sideways8 Simple Taxonomy Images
Taxonomies without images (6 posts)

  1. Marco Chiesi
    Member
    Posted 1 year ago #

    It looks there's a litte issue with function s8_get_taxonomy_image. I would expect it to return FALSE for categories / taxonomies that do not have an image. Instead it return an image with empty src like this:
    <img src="" alt="Category" />

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

  2. Sideways8 Interactive, LLC
    Member
    Plugin Author

    Posted 1 year ago #

    We should have this resolved by tomorrow.

  3. Sideways8 Interactive, LLC
    Member
    Plugin Author

    Posted 1 year ago #

    There is now a new version of the plugin. Check out the changelog.

  4. Marco Chiesi
    Member
    Posted 1 year ago #

    Thanks for your reply.
    I just updated to the new 0.8.1 version but it seems the problem is still there.
    The html code is slightly changed (a class was added compared to previous version), but I am still getting empty images for taxonomies with no images associated.

  5. Sideways8 Interactive, LLC
    Member
    Plugin Author

    Posted 1 year ago #

    Hmmm.... I'm guessing you are using this in a theme, right? If so, can I get what you are working on? (zip it up and get it to me?)

  6. Marco Chiesi
    Member
    Posted 1 year ago #

    Well, I am not really using this in a theme, but I made a shortcode based on your plugin to be used in conjunction with the Views plugin.

    However to reproduce it, you don't need the Views plugin. It is sufficient to add the following code to a custom site-specific plugin or to the theme functions.php:

    add_shortcode( 'taxonomy_image', 'taxonomy_images_shortcode' );
    function taxonomy_images_shortcode( $atts = array() ) {
    	extract( shortcode_atts( array(
    		'field' => 'id',
    		'value' => '',
    		'taxonomy' => 'category',
    		'output' => 'OBJECT',
    		'filter' => 'raw'
    	), $atts ) );
    	$term = get_term_by( $field, $value, $taxonomy, $output, $filter);
    	return s8_get_taxonomy_image($term) . $term->name . '<br />';
    }

    and then use the shortcode in a post/page this way:

    [taxonomy_image value="1"][/taxonomy_image]

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic