how i can add title to my featured image?

I’m not sure about your question, but the below code is more correct. $attr = array( ‘title’ => get_the_title(), ‘alt’ => ‘a nice view of the ocean’, ); echo sprintf( ‘<a href=”https://wordpress.stackexchange.com/questions/281220/%s”>%s</a>’, get_the_permalink(), get_the_post_thumbnail( null, ‘post-thumbnail’, $attr ) );

Default Featured Image from Post content

Ok guys.. I got it finally working with my below code. function wpse55748_filter_post_thumbnail_html( $html ) { // If there is no post thumbnail, // Return a default image global $post; $pID = $post->ID; $thumb = ‘large’; $imgsrc = FALSE; if (has_post_thumbnail()) { $imgsrc = wp_get_attachment_image_src(get_post_thumbnail_id($pID),$thumb); $imgsrc = $imgsrc[0]; } elseif ($postimages = get_children(“post_parent=$pID&post_type=attachment&post_mime_type=image&numberposts=0”)) { foreach($postimages … Read more

Adding Images into API

from the support forum of that plugin: Your cpt may not be registered correctly. Try adding this to your functions.php (change “event” to your post type slug): add_filter( ‘register_post_type_args’, function( $args, $post_type ) { if( ‘event’ === $post_type ) { $args[‘show_in_rest’] = true; } return $args; }, 10, 2 ); or make sure that you … Read more

How to add custom label or texts in featured image

You can do this by calling a javascript file for admin. Create a javascript file in js folder in you current theme called admin.js. inside the file add this code: jQuery(document).ready(function($) { $(‘#postimagediv .inside’).prepend(‘<p>Recommended image size 300*300px</p>’); }); Now in functions.php in your current theme folder add this code to call the javascript file exclusive … Read more