• Resolved jefflowyz

    (@jefflowyz)


    Hi,

    I’m running into some trouble customising my website.

    The default setting on my wordpress site initially doesn’t show captions for my featured images. Upon customising my functions.php using a code I found online, it worked beautifully on Chrome and Firefox, but there’s a problem on Safari. The featured images are now no longer showing up.

    Could anyone help?

    My website is https://style-revisited.com.

    The addition I made to my function.php file is as below.

    <?php
    function monahans_thumbnail_caption($html, $post_id, $post_thumbnail_id, $size, $attr)
    {
     $attachment =& get_post($post_thumbnail_id);
    
     // post_title => image title
     // post_excerpt => image caption
     // post_content => image description
    
     if ($attachment->post_excerpt) {
       $html .= '<p class="thumbcaption">';
       if ($attachment->post_excerpt) {
         $html .= '<span class="wp-caption-text">'.$attachment->post_excerpt.'</span> ';
       }
     }
    
    	return $html;
    }
    
    add_action('post_thumbnail_html', 'monahans_thumbnail_caption', null, 5);
    ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Featured Image not showing in Safari’ is closed to new replies.