Tagged: header tags, Images
-
AuthorPosts
-
October 10, 2024 at 7:29 am #1468770
I’d like to change the captions (of some) images to H3, how can i do that? (not just in style, but to make them actual H3)
October 10, 2024 at 5:52 pm #1468856Hey Peter,
PLease include a link to your page as there are a few different solutions depending on the element used.Best regards,
MikeOctober 19, 2024 at 1:45 pm #1469437Hi Mike, its for https://fysiobreda.thedigitalmanager.nl/
there is the section on the homepage with ‘hier heb ik pijn’ with images of ‘rug’, ‘schoulder’ & ‘elleboog’ under it. I’d like the caption of those images to become H3.-
This reply was modified 1 year ago by
the_digital_manager.
October 19, 2024 at 4:41 pm #1469452Hi,
Try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:function custom_h3_script() { ?> <script> (function($) { $(function() { function replaceElementTag(targetSelector, newTagString) { $(targetSelector).each(function(){ var newElem = $(newTagString, {html: $(this).html()}); $.each(this.attributes, function() { newElem.attr(this.name, this.value); }); $(this).replaceWith(newElem); }); } replaceElementTag('.av-image-caption-overlay-center p', '<h3></h3>'); }); }(jQuery)); </script> <?php } add_action( 'wp_footer', 'custom_h3_script', 99 );Best regards,
MikeNovember 22, 2024 at 4:12 pm #1471951Hi @Mike. that doesnt seem to work. images are still h1. is there another way to change this?
November 22, 2024 at 4:25 pm #1471952November 22, 2024 at 4:32 pm #1471955@mike ! awesome! case closed:) many thanks
-
This reply was modified 1 year ago by
-
AuthorPosts
- The topic ‘Change caption of image to H3’ is closed to new replies.

