How to get Thumbnail URL in WordPress
Hi everybody, here is a simple snippet which allows you to extract the source of the post thumbnail image on WordPress. It’s very useful if you need post thumbnail URL to use in your code.
Simply copy and paste the following code to your theme template. Please make sure that the code is pasted within the loop.
// Get WordPress Thumbnail URL
$image_id = get_post_thumbnail_id();
$image_url = wp_get_attachment_image_src($image_id);
$image_url = $image_url;
It's only fair to share...
Posts you may like:
Awaken magazine/news WordPress theme
Awaken WordPress theme is an elegant magazine/news WordPress theme. It has a magazine layout with …
Onetone WordPress business theme
Onetone is a one-page business theme based on Bootstrap framework and coded with HTML5/CSS3. All …
AppsWorld – WP Landing Page Theme
AppsWorld is a fully responsive app landing page theme for WordPress. If you want to …
Customizr free WordPress theme
Customizr is a free WP theme which is very easy to customize as the name …
Auberge free restaurant and cafe WordPress theme
Auberge is a modern responsive, retina-ready restaurant and cafe theme for WordPress websites. Auberge supports …