wp_get_attachement_image wants the second argument to be an array of width, height
like:
array(‘900’, ‘1200’).
So in your example if attachment id is 1096, width is 219, and height is 98, it would be:
<?php echo wp_get_attachment_image( 1096, array( 219, 98) ); ?>
If you’re looking for the un-cropped, full image:
Instead of using wp_get_attachment, try wp_get_attachment_image_src and pass a size argument of “full.”
This returns an array:
(false|array) Returns an array (url, width, height, is_intermediate),
or false, if no image is available.
So we get the url like so:
$attachment_id = '1906';
$image_array = wp_get_attachment_image_src( $attachment_id, 'full' );
echo '<img src="'. $image_array[0] .'" >';
Related Posts:
- WooCommerce single products images doesn’t zoom on hover and doesn’t change clicking on gallery
- woocommerce image product add a class and data-src attributes
- WordPress Twenty Seventeen header image size not responsive for mobile
- How to upload images from wordpress front-end (the first image must be thumbnail and the rest without first must be in gallery woocommerce product)
- How to delete 1000s of duplicated images in WordPress?
- Some images aren’t shown on wordpress after installation on host
- Add custom CSS class to product images
- Woocommerce product image [closed]
- How do I make the product image smaller on a WooCommerce product page?
- Updating product image
- Images not uploading on product page of woocommercr
- How to solve `Error getting remote image` in woocommerce rest api script?
- Images not showing on site – Even though they are there
- Delete product image using WooCommerce API?
- Set Post Thumbnail to external URL
- Correct method of reducing the number of images created by WP and Woo together
- Titles with thumbnails in media library
- WordPress pointing animated GIF images with wrong file name upon upload (GIFs animation not working)
- Blurry product card image – rendered is 486×452 vs 300×279 in real image. Smaller versions being autocreated and served using srcset
- Export Woocomerce Image Product URL
- How do I get my image for my product to not be blurry
- Woocommerce Gallery Image Caption: Use “caption” — not “alt tag”. Keep alt tag as is
- Pass custom Checkout field value to Stripe gateway in WooCommerce
- WooCommerce Shop Page Not Found 404
- How can I show an empty WooCommerce cart? [closed]
- Woocommerce : How to attach an custom attachment with customer-processing-order.php email template [closed]
- Woocommerce Pre Orders – Can i override templates?
- Woocommerce checkout via external page [closed]
- Programmatically adding product attributes to WP / Woo commerce
- Display File Types For Woocommerce Downloadable Products On Product Page
- Apply Additional Discount after coupon
- Is it possible to add a sidebar to Storefront’s Welcome page
- Programmatically setting Woocommerce product price
- remove categories from product
- WooCommerce Display Digital Download Files Type and Size
- woo commerce get all orders item given category
- Add Stripe Connect data to wc_stripe_payment_request
- WooCommerce get default shipping rate & conditions
- Using WooCommerce for payments only?
- Programatically Remove Item from Cart Not Working – Needs Page Refresh
- WooCommerce – Stock in Decimals, Using Quantity Intervals with Unique Prices [closed]
- Set default value field meta_Value [closed]
- WooCommerce Cart Link based on Cookie Values
- Additional fields on Woocommerce’s rating system
- Question on WooCommerce Syntax
- woocommerce_new_product action doesn’t fire
- Change The Woocommerce Product Categories Dropdown Widget Placeholder Text
- how to create additional button on single product page
- minimum order item for certain products exempting 2 other products (in bulk)
- Is it possible to checkout with 2 different shipping options on a single order? [closed]
- Sender e-mail address, for new order email to customer, is suddenly wrong [closed]
- Pass class to Woocommerce shortcode [relative_products] [closed]
- Undo WooCommerce CSV import
- A Woo commerce extension has deleted my old theme.How to undo? [closed]
- How can I remove a WooCommerce Product Tab’s sub section in wp-admin?
- is_shop doesn’t work for woocommerce [closed]
- Woocommerce Advanced Shipping (WAS) condition is not being called when selecting “Ship to different address” [closed]
- How to make footer area transparent? Using Avada and WordPress [closed]
- Strip string from $_product->get_title() to get a cleaner mini-cart
- Product page attributes dropdown show price
- Smart Design for Blog + Woocommerce + LearnDash + Forum/Bodyboss
- Ajax add to cart not updating Elementor mini cart totals
- I want to store user password (during registration) in an other table in the same database in addition to the user table MD5 Hash
- How to edit the default woo-commerce Store page meta title tag “Products”
- WooCommerce – 500k Jump in Order Number?
- Custom Email via Hook only for completed order
- Need help with woocommerce roles
- Change WooCommerce product and variation prices programatically without affecting performance
- Help to locate a woocommerce hook method
- woocommerce_product_quick_edit_save hook not fired
- Changing Title Tag on Shop Archive Page (current solution reverting to Title of First Product in Loop)
- What is the meta_key for woocommerce discount amount?
- Can I use taxonomies to make a multistore with woocommerce?
- Why does wc_get_products($arg) return no products when $arg = ‘average_rating’ => 5.0
- Query product’s image path by category WooCommerce database?
- Delete comma in front of currency woocommerce
- Not displaying Category and subcategory from woocommerce Pluign
- How update price for variable product
- currentURL is not defined
- Related products based on keywords
- Add button linked to single product page on order detail page
- Exclude first image from a Woocommerce image gallery
- Woocommerce REST API not considering discounts and coupons
- Multiple sorting criteries (order by)
- syntax error – woocommerce
- How to on/off woocommerce filter with redux framework [closed]
- How to set up a single product shop with woocommerce? Skipping the product archive
- I’m trying to display product categories on each product in the list
- Cross-sells on WooCommerce product page
- Admin Order adding an extra product on add_line_item
- Woocommerce update cart
- Get WP All Export row ID
- Is it possible Different templates of products for specific category in WooCommerce?
- WooCommerce – missing products when viewed by tag
- Hiding all products except for one in wordpress admin panel
- Allow authors to use their own PayPal account and payment process automation [closed]
- Can a woocommerce hook alter the UI of a website?
- cannot create product attribute (taxonomy) and add terms on the same execution
- How to change “reply to” email address for specific Woocommerce products
- Product Variation Auto Select when only one 1 and mark the option [closed]