1
I’m using the plugin https://wordpress.org/plugins/taxonomy-images/ to relate images to categories, and I’m printing icons next to the post title so(code below) but it brings all related categories and I wanted to limit to only one someone can help me?:
<?php
print apply_filters( 'taxonomy-images-list-the-terms', '', array(
'attr' => array(
'alt' => '',
'class' => 'img-responsive',
'src' => '',
'title' => '',
),
'before' => '<div class="">',
'after' => '</div>',
'before_image' => '',
'after_image' => '',
'image_size' => 'detail',
'post_id' => get_the_ID()
) );
?>
change your first line after
<?php
forprint apply_filters( 'taxonomy-images-queried-term-image', '' );
– João Victor Gomes Moreira
It limits on some and other error pages =/
– Matheus Barem
Category pages work but when I go to Home it doesn’t work, only with old code
– Matheus Barem
I edited the answer, try again
– João Victor Gomes Moreira
The problem persists =/
– Matheus Barem
The error here persists because the theme used (Odin) does not support this type of query (this is the error printed here at home).
– Matheus Barem
Could edit the question with the error you are giving?
– João Victor Gomes Moreira
Notice: term_taxonomy_id is not a Property of the Current queried Object. This usually Happens when the taxonomy-images-queried-term-image-id filter is used in an Unsupported template file. This filter has been Designed to work in taxonomy Archives which are Traditionally served by one of the following template files: Category.php, tag.php or taxonomy.php. Learn more about template Hierarchy.
– Matheus Barem
I copied the above error
– Matheus Barem