Hello together!
When embeding an image with caption into a post or page WordPress assigns an ID and a Style with a width to the DIV which surrounds the image with caption. It outputs the following code:
<div id="attachment_45" class="wp-caption alignnone" style="width: 308px">
<img class="size-full wp-image-45 " title="1029" src="http://www.example.com/linkto.jpg" alt="Alt_Text" width="298" height="298" />
<p class="wp-caption-text">Caption Text</p>
</div>
<p>Regular text here<br />
I would like to modify the code so that it basically looks like the one below. I would like to be able to just assign my own class to the surrounding DIV, no class to the image and no Paragraph tag for the caption text.
<div class="pic-caption block">
<img src="http://www.example.com/linkto.jpg" alt="Alt_Text" width="298" height="298" />
Caption Text
</div>
<p>Regular text here<br />
I tried to figure out how to do that but hit a wall because this is automatically generated within <?php the_content(); ?>.
I realize that I could just modify my own CSS to get the same look I want but would prefer to modify the output so that it looks like my example above.
Any help would be highly appreciated!
Thanks a lot,
Martin