My website has a function that adds custom html under images to output the caption and credits of the photo. But this function doesnt contemplate the image having credits and no caption, so if it has no credits the image doesnt even make the function and is outputed inside a p tag and an image class that i dont know where it is generated. I wanted to make a condition to check if an image has credits and no caption in the shortcode and if it does, add a specific html span class to this p tag. Does anyone know how i can accomplish this and where i can manipulate this p tag that wordpress creates to wrap around images?

Read more here: add custom html to images in order to show photographer credits


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: