Hi, thanks for your support.
I have inserted the code with this format:
<?php if(function_exists(‘rdv_category_image’)){
echo ‘Patrocinat per ‘;
rdv_category_image(); } ?>
The text appears correctly before the image. However, this text also appears on category pages where no image is defined.
With this code I’m trying to detect if the function returns an image so I can discard the text when it’s not needed:
<?php if(function_exists(‘rdv_category_image’)){
if ( true === rdv_category_image() ) {
echo ‘Patrocinat per ‘;
rdv_category_image();
}
} ?>
I have also tried this other way:
<?php if(function_exists(‘rdv_category_image’)){
if ( true === rdv_category_image() ) {
echo ‘Patrocinat per ‘ . rdv_category_image();
}
} ?>
In both cases the image is displayed but the text is not displayed.
How could I detect if the function returns an image so that I can discard the text when it’s not needed?
Thanks in advance.