Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #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)

    #1468856

    Hey Peter,
    PLease include a link to your page as there are a few different solutions depending on the element used.

    Best regards,
    Mike

    #1469437

    Hi 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.

    #1469452

    Hi,
    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,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.