1
On one page, there are links that point to images.
<a class="native-class" href="http://localhost/test/wp-content/uploads/2017/10/7-3.jpg"></a>
I am aware that I could add another class using the class native-class
but what I want to do is add another class to that specific link if href is an image. .png, jpg, gif
etc..
I did an answer but I was in doubt. What do you mean by "specific link"?
– Sam
@dvd that’s the comment I was writing when you removed the answer rsrsr. Yes, it is a very elegant solution! But in fact, what I would like to use as a value only href if it is ['jpg','png','gif','svg'], it is because of that class
native-classe
will not always exist, I just put it to exemplify.– John Quimera
@dvd I want that if a link has in href the address for an image, add a class.
– John Quimera
@dvd your answer was right and solved the problem if I was going to use the class
native-classe
. The basis for placing the class must always be the value of href.– John Quimera
I restored the edited answer
– Sam