why didn’t use add_image_size( 'horizontal_img', 800, 300, true ); add_image_size( 'vertical_img', 300, 800, true );
And then
$image_hor = wp_get_attachment_image_src($post_id,'horizontal_img');
$image_ver = wp_get_attachment_image_src($post_id,'vertical_img');
when
echo $image_hor[0]
you will get your desire sized image url.
Thanks
Musa
Related Posts:
- How do I disable responsive images in WP 4.4?
- Set default image sizes in WordPress to hard crop
- After Moving a Site to Another Domain, All Images Are Lost
- How to find attachment by it’s name?
- Which action hook can I use when a featured image has been selected
- How to disable “insert into post” only when selecting the Featured Image?
- Is there a way to define a default caption to all uploaded images
- How can I add the “Use as featured image” to a custom metabox?
- Image resize with image url
- Get an image from url in front end submission form
- How to force WordPress to add new images at the beginning of the gallery?
- Why would image paths in wordpress suddenly change?
- Re-process Images
- Show prev and next post links for parent post of current image in attachment page?
- could not upload image in media library
- Check if page/post has any anchors that link to an image jpg/gif/png
- Image File Names
- Images in upload folder with hexadecimal names
- How to check if user is uploading/setting an image as a featured image?
- JavaScript and images files are not recognized
- Retrieving an alt tag from a custom field
- Exclude featured image from gallery in wp-admin
- Trying to create a mouseover effect in html using Gutenberg editor
- How to output images as figure/figcaption
- Make Images appear in the same order as in media browser using get children?
- wordpress get gallery images title
- How to wrap normal image tag with figure HTML5 element
- How to fix “.webp” being auto-added to the end of image urls
- Customizing the attachement page to show rest of all images in a gallery from post
- having issue while uploading An error occured in the upload. Please try again later
- How to change image atributes right before an image to be saved?
- Is it possible to change ‘Link to’ in all images in all articles?
- Is it possible to put images as url in document [closed]
- Creating ‘required’ fields in the ‘add media’ window
- Importing images results to wrong folder structure
- How to replace images?
- Upload image without media-upload [duplicate]
- Tinymce and uploading local pictures
- Time Based change of image
- Where is the right place to store custom images?
- Resize images in batch
- how to get image full path from WP_Post Object?
- Featured Image problem with resizing
- WordPress Image Scaling Quality
- Create a post from every image in my media gallery
- Advice on image heavy site, compression and slow page loads
- Not seeing text alignment option in Image block
- wp_get_attachment_url images in wrong order [closed]
- Auto delete pictures in media library by age
- Migrated site – Images have 404 error
- Show (print) featured image all dimensions (height, width)
- Speed Up Website With High Resolution Images
- Allow SVG in WP step by step
- Serve different images per screen size and cache possible?
- Convert featured images into “product images”
- How come the images arent loading properly?
- How to use the thumbnail size with catch_that_image
- Not able to retrieve image id from sibling site within a switch_to_blog
- How to display a warning when an uploaded image is too small?
- How to link image in WordPress – Elementor when certain element does not offer that option?
- Large uploaded images not resizing?
- Having an issue in compressing Images in wordpress site
- How to generate alt attributes with php / filters?
- Custom image size not displaying with wp_get_attachment_image()
- unsharp thumbnails after uploading image
- How to delete original image file after upload and resize
- Image links broken / “DNS Update Required” message
- Convert multiple image blocks to gallery block in Gutenberg?
- WordPress After migration some images src is empty
- Access html element in media modal with jQuery
- Image sizes reset when changing theme
- How to get featured image of last post in a category?
- How can I add “alt” tag to element?
- How to make image uploads default to full size?
- Recovered WordPress installation (on localhost) links broken and images not showing
- Image is missing on site homepage
- Media sizes do not appear
- How to make Facebook share the featuterd image from url on WordPress
- Changing current post image uls with a function
- Delete images of a particular size
- How to watermark wordpress images from wp-content/uploads folder with htaccess and php?
- How to display every pictures from all the posts on one page?
- How to add multiple images in a page
- Images not rendering
- Retrieving Image Storage path
- how to display all images from their siblings/ from same parent?
- Define Folder to save Images
- Specify what to do for a specific image number of the post
- adding images to wordpress pagination?
- How do you change all images dimensions to have the same size?
- Images getting corrupt automatically
- Thumbnail size keeps resetting automatically
- How to add a link to media file for every image inserted in content?
- How to get WordPress to resize images for srcset?
- How to give path to image in wordpress?
- Edit multiple posts featured image
- Make Jetpack CDN to filter/ignore images based on SRC [closed]
- images map on website not working
- WordPress + REST API + featured_image
- Some images not loading after changing IP on local wordpress install