Answer the question
In order to leave comments, you need to log in
How to change the output of the html markup of a post in WordPress?
How do I make it so that, for example, in my wordpress theme, it is possible to wrap all the img from the post in a div or add an additional class to the element?
For example, wp displays the default post image in html like this:
<figure>
<a href="link_url"><img class="aligncenter" src="img_url" alt=""></a>
</figure>
<div>
<a href="link_url"><img class="aligncenter my_class" src="img_url" alt=""></a>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question