Site logo

Archived topic

Copyright Picture

11 replies · Started by midiman on April 5, 2020

Viewing posts 1–12 of 12

Hello, how can I insert a copyright text under the picture?

Hi there,

Under what picture?

Can you link me to the page in question?

Thanks :)

Hello, under main picture. How can I upload a photo to you?

Hi there,

for screenshots - please provide the full URL to a share drive where the image is located.

where should I put that?

add_filter( 'post_thumbnail_html', 'custom_add_post_thumbnail_caption',10,5 );

function custom_add_post_thumbnail_caption($html, $post_id, $post_thumbnail_id, $size, $attr) {

if( $html == '' ) {

return $html;

} else {

$out = '';

$thumbnail_image = get_posts(array('p' => $post_thumbnail_id, 'post_type' => 'attachment'));

if ($thumbnail_image && isset($thumbnail_image[0])) {

$image = wp_get_attachment_image_src($post_thumbnail_id, $size);

if($thumbnail_image[0]->post_excerpt)
$out .= '

';

$out .= $html;

if($thumbnail_image[0]->post_excerpt)
$out .= '<p class="wp-caption-text thumb-caption-text">'.$thumbnail_image[0]->post_excerpt.'</p>

';

}

return $out;

}
}

I use Elements, is that also possible?

Not using that Code.

But you can add this to a Hook Element:

<?php
$get_description = get_post(get_post_thumbnail_id())->post_excerpt;
if(!empty($get_description)){    
    echo '<span class="featured_caption">' . $get_description . '</span>';
}
?>

Select the before_content hook, check execute PHP and set the Priority to 15.
NOTE: This will place it below the container the featured image sits in.

Thanks

You're welcome

This archived topic is closed to new replies.