Why don’t you use this add_image_size( 'custom-thumbnail', 300, 300, true );
in funtions.php
and call it <img src="<?php echo get_the_post_thumbnail_url('custom-thumbnail'); ?>">
in your page?
Related Posts:
- How do I change/modify the_post_thumbnail(); html output?
- What’s the best way to use the Featured Image for responsive web design?
- Adding Featured Image to Post programatically
- How to upload imagick resource to media in wordpress
- How do I get images (with a thumbnail preview) to show in search results?
- Assign a picture URL to a page via PHP
- How to scale image with equal width and height without distortion?
- Echo URL of large version of Featured Image
- Recent posts with featured image or fallback image with permalink
- Set the background to a default image if there isn’t a specified “featured image”
- Three Questions with Twenty Eleven theme
- Resize image to specific dimension (X to Y ratio)
- Get featured image with custom size outside WordPress
- Else/If Statement to Display Photo Descriptions
- How to set a featured image (thumbnail) with PHP?
- Generate responsive post thumbnails of same size
- How to Make Thumbnail of Post Stay Animated
- not outputting medium size image URL
- Replace background image with post thumbnail in shortcode
- add class to background image
- Setting post thumbnail sizes in template file and functions.php
- add if statement to the featured image
- Remove default Image Sizes
- Generate and upload screenshot as featured image for user-submitted post
- Restricting Image Upload Sizes using ‘wp_handle_upload_prefilter’ – Stuck media progress bar when Featured Image?
- How to get next image with this code from same post?
- Unread Repeater field IMG alt not working
- Can’t upload image using media_sideload_image
- Upload multiple images to a Woocomerce product
- How to use thumbnail size of image if I’m only using src to get image
- Display custom post type title as text if post thumbnail is not available
- What is the alternative to “ when it comes to calling Media (image) files in the ‘attachment.php’ file?
- Accessing an image folder inside public web directory
- get_children displaying images removed from the page
- Why is image hard cropping for one image using add_image_size not working?
- Enable custom logo upload if logo is not in header
- Why my image upload button is not working in wordpress widget area?
- Scrape external webpage for first image and add it to new post
- How to make own crop image function for WordPress plugin
- “imagejpeg” function is not working in wordpress
- Display image from an external rss feed on wordpress without plugins
- Redirect to another page using contact form 7? [closed]
- WordPress automatically adds links to uploaded images
- post thumbnail, conditions, else wont work
- WordPress function when file is uploaded, deleted or edited
- ‘Post-thumbnails’ feature does not seem to register
- height should be set to auto to avoid pixelation in the post thumbnail function
- Download images from media library to computer in BULK?
- Display related posts without a plugin
- How to loop through all the attached images in a post, and get their url one by one
- Which function crops images in wordpress?
- WordPress function and string as variable?
- Division by zero error in image.php
- How can I automatically resize up images to fit into all of my registered image sizes
- Clickable image link sends people to wrong URL
- Apply class to every third list item? [duplicate]
- Only show image from custom field when present
- Timthumb.php image gallery not working on Multisite WordPress
- Upload non-featured image to image field
- Automatically add images to a menu
- Where are the src and srcset sizes coming from?
- HTML showing after PHP code in tag
- Only show first image in foreach loop
- trying to get wp_get_attachment_url to output clickable link
- Using featured image of blog archive page
- Change default gallery images – Currently they are displaying full size imagese
- if custom field doesn’t exist, use post thumbnail instead, as image background
- I’m unable to call img path using single quotes in an array?
- Creating black and white copy of an image [closed]
- Help Fallback (thumbnail)
- Get the id of all images in a post
- Shortcode function doesnt work without caption
- How to add post thumbnail dynamically using Jquery?
- Images Uploaded saving onto older/previous year folders
- Display an image based on field value
- Add valid XHTML closing img tags to WordPress galleries
- Convert canvas to image and upload image to server
- How to change thumbnail src attribute?
- Error display post thumbnails for previous and next post
- Controlling image output size ACF repeater [closed]
- Image rotation issue (horizontal picture uploading as vertical) — Exif issue?
- WordPress İmages Upload & Delete Error
- Get the featured image url of clicked post
- Fallback image URL if no featured image exists via a shortcode function
- How to replace URL protocol using PHP?
- Call featured image url
- How to pick “full/thumbnail” images in the loop?
- Get the alt text of the image in a array
- Display post thumbnail in foreach loop
- Attaching images to posts manually (i.e. with custom code, without the use of an API)
- Adding a ‘style=’ bit to image_send_to_editor output
- Convert all uploaded PNG files to PNG-8 format
- foreach repeat html structure after every nth for attachment [closed]
- Trying to change featured image from 180×180 to full width on home page
- Show different size featured images (the_post_thumbnail) for 1st, 2nd and 3rd posts?
- CSS images don’t show up with bloginfo
- how to show images without passing it to timthumb.php file for resizing
- How to internationalize header image?
- Some problems in custom widget
- Displaying images outside the content