Tagged: ,

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #342150

    Hi Team!

    How can I make enfold display the “caption”-Field (or any other image field) beneath the image on a regular post? For example: http://www.teensmag.net/jobreport-tourismuskauffrau-mann/
    The Caption-Field in the image-Library says “The Lost Traveler_martinak14-Flickr”. This should be displayed under the image (or in an overlay), as it complies with german copyright law.

    Can you help?

    Rolf

    #343263

    Hi Rolf,

    Try adding this at the very end of your theme / child theme functions.php file:

    function add_custom_script(){
    if(is_singular('post')){
    ?>
    <script>
    (function($){
        $(window).load(function() {
        	var postImage = $('.single-big .wp-post-image');
            var imgAlt    = postImage.attr('alt');
    
            postImage.after("<div class='img_caption'>"+imgAlt+"</div>");
        });
    })(jQuery);
    </script>
    <?php
    }
    }
    add_action('wp_footer', 'add_custom_script');

    Regards,
    Josue

    #343957

    Thanks, that works. Couldn’t you build that in as an option to enfold, so people don’t have to mess with their functions.php?

    #344133

    Hey Rolf!

    Feel free to request it here. Also, if you use a child theme you can store functions like this in the child theme functions.php.

    Best regards, 
    Josue

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