Does anyone know how to remove all of this from the image HTML?
class="aligncenter size-full wp-image-31053"
Does anyone know how to remove all of this from the image HTML?
class="aligncenter size-full wp-image-31053"
Comments are closed.
Take a closer look at get_image_tag() which can take a lot of parameters like
$id
,$alt
,$title
,$align
,$size
.If you look even closer you’ll find the
get_image_tag_class
filter to change the image class names (like class, ID, align and size).You can use the filter within your
functions.php
like this:Note: This will still return an empty tag like:
class=""
Update: To completely remove everything related to the class you’ll have to filter the
$html
: