use this one and follow the structures
$post_thumbnail_id = get_post_thumbnail_id( $post_id );
$imgarr = wp_get_attachment_image_src($post_thumbnail_id,'medium');
echo $imgarr[0];/*it will return image url in medium size*/
Related Posts:
- Make Custom Metaboxes Collapse by Default
- Check for and enforce unique value in user-entered custom meta field in WP Admin
- Why doesn’t WP_Image_Editor save images using the Filesystem API?
- Is there a plugin to make attaching images easier?
- Managing Images for a WordPress Blog: Picasa or Flickr?
- Automatically wrap post image in div
- Custom image size not selectable in uploader
- Retrieving and Storing Images Linked from Other Domains on Local Server?
- Customizer image control default value showing in customizer but not on frontend
- Importing media medium setting image gallery / image attachments
- Extract & Display the REAL first image attached to a post – extend the_post_thumbnail()
- Add ‘Right Now’ widget to custom dashboard
- Add filename to attachment page url
- How To Add buttons to the toolbar which appears in TinyMce when you click over images
- Image Editor does not affect custom sizes!
- How to display post title & excerpt when mouse hovers on an image?
- Automatically add image caption with values from a post parent field?
- Is there a way to dynamically get to your uploads folder?
- The Best Way to always load the newest version of 3rd party code
- Using Fullscreenr with a wordpress blog – weird bug
- I’m using add_meta_box() but want to include TinyMCE editor *and* Media Uploads for each box
- Get Image from Media Library with the Title
- Get Custom Logo Alt Text
- custom meta box for page default template
- Using custom image resizing script in a page
- Background image not appearing
- Best way to allow overwriting images shipped with the plugin?
- NextGEN Gallery – open all images on page in fancybox [closed]
- Data won’t save if metabox within conditional in admin. What am I missing?
- Featured Image If Else Condition
- If custom image header does not exist display text header
- Is there a possiblity to replace profile image gravatar with custom user images
- Let author add field to metabox by pressing a button
- Custom theme – how to link the image without posting it
- Meta Tags by Meta Box
- Trying to set specific image dimensions and crop with ACF
- Showing Meta Box via Jquery Checkbox
- problem saving/ retrieving custom meta with wp alchemy metabox
- Replace TimThumb in existing WordPress Themes
- Customizing the gallery of the post correctly
- WordPress 3.1.2 Bug: add_theme_support() and video post format registering twice
- Personalized Gallery what are my options?
- Select input in metabox not updated
- Multiple header style under meta box
- adding fade on mouseover to images
- Lightbox not showing image caption
- WordPress 5: including larger thumbnail image sizes in srcset than I have set
- Adding a drop-down (select tag) option under Menu Settings in WordPress Admin
- POST 429 Error when trying to place more than 20 images into post at once
- I want to use a product thumbnail completely different than the product image
- Change meta-box title- “LearnDash Quiz Settings” to “Quiz Settings”
- Embedded Options in a Custom Metabox
- How to add the option to choose between sizes for featured image within post editor?
- duplicate featured image functionality in custom meta box
- Creating custom setting in add media popup
- WooCommerce Variation Swatches and Photos – get attribute thumbnail
- How to add custom Author Info Box to blog posts “only” and NOT custom post templates
- Upload image without resizing but insert in post with resizing
- Bio comes up when the visitor clicks on a picture
- Adding images to anchors in the list created and fetched with wp_nav_menu
- issue with saving custom metaboxes fields
- after checked the checkbox in backend, dont show social link on frontend
- Change default “Apply Changes To” radio option when editing images
- Change post template the proper way
- WP_Customize_Image_Control and selecting from library?
- How to strip thumb from widget
- Upload button in metabox not working
- featured images – custom links
- Custom image sizes ignored in WP 3.5
- Need Advice to Working with Custom Post Meta
- Edit image alignment in WordPress twentysixteen child theme on attachment page [closed]
- Set custom banner image size with wp_customize
- How to search for replacement titles and contents, excluding image URLs
- Custom Search on media files PDF images pages posts
- difference between esc_attr(), strip_slashes(), strip_tags()?
- How to add a “data-” attribute to the image tag of native gallery output
- Looking to display non-image files in Gallery with logo specific to file type
- Is it ok to not a have child theme and just create a theme from scratch?
- How to Remove Subscribers from the Post Author Drop Down
- Search a post using the date it was posted
- How do I change the markup only of a built-in widget?
- Is it possible to make widget return only data (eg, array)?
- Can’t generate thumbnail images
- Multi-site User Sessions
- How to create a control for css opacity in the Customizer
- add an option to the read page
- Save Textarea on WordPress Frontend
- How to custom post navigation
- Customizing Comments
- More Fields: Input “Values (if applicable)” is disabled
- Remove Category titles from individual posts on archive pages
- Moving Quantity after product description
- Calling get_theme_mod() of an WP_Customize_Image_Control() returns an Array, how do I correctly return the image src for my custom theme?
- Replace Vimeo and Youtube in from scratch theme with from-the-group-up single post template?
- Add commentmeta custom field to every published comment with SQL
- How do I change text of a product template in a WooCommerce theme? [closed]
- Customized Comment Form Issues
- Pull certain WordPress posts on custom CMS instead and 301 wordpress to it?
- Create users via PHP
- Applying my own css classes in wp_menus 3?