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
- WooCommerce: How to edit the get_price_html
- Get woocommerce product price by id [closed]
- Woocommerce: How to remove page-title at the home/shop page but not category pages
- Hidden woocommerce products still showing up in search results [closed]
- Preventing WooCommerce email sending only on particular conditions
- Woocommerce view order link in customer emails
- Filter on a custom product attribute in WooCommerce using meta_query or tax_query [closed]
- Woocommerce : How to attach an custom attachment with customer-processing-order.php email template [closed]
- Is is safe to edit language files from wp-content/languages/plugins/woocommerce-ro_RO?
- Does the woocommerce_order_status_changed hook fire when WooCommerce updates an order status automatically? [closed]
- Mini cart in header using divi is not getting updated on changing the cart items count:
- Separate Categories from WC Product loop when display type is set to both on the category
- How do I hide out of stock products from homepage but not from catalog?
- Woocommerce order processing email subject not changing
- Different translations for the same plugin inside a multisite
- Woocommerce multiple taxes with same rates adds as different values.
- function to add note on single Woo Commerce product page for downloadable variations
- Apply Additional Discount after coupon
- Is it possible to add a sidebar to Storefront’s Welcome page
- Modify SKU for display on product page
- Permalinks contain unwanted space resulting in broken links
- WP_Query with meta_query for children
- WooCommerce product archive url without value / all values
- Woo commerce+ Stripe – How to associate one account per currency [closed]
- Sort & Display WooCommerce Product Attributes by Order
- Adding product info for printing to custom Woocommerce Product Display tab [closed]
- How to search variable product by its variation id in woocommerce admin product search box?
- Add shipping address to Woocommerce order emails [closed]
- A function to add arguments to a taxonomy
- Different Templates for Woocommerce Parent and Child Sub Categories
- add sub subpage endpoint to woocommerce plugin my-account section
- Woocommerce changing add to cart button text as icon [closed]
- how to change the “return to shop” button text? [closed]
- Problem while adding the variable product woocommerce
- Use existing image sizes for WooCommerce
- How do I create a filter to hide the One Click Accessibility plugin button in WordPress?
- customers are not showing up in woocommerce
- Hooks For Design variation in woo commerce single product page
- Dokan stock management
- Woocomerce Edit source code of form in wordpress
- Woocommerce : How to automatically input the same email for every order?
- Woocommerce – Change order of products in Confirmed Order
- echo product parent category
- How to edit wc_get_template_part for archive products
- Switch to user link shortcode
- Woocommerce – how to round up all prices to end in .99
- Display WooCommerce product attribute on shop page
- How to get product category ID based on post?
- Jump to Footer On Scroll – Woocommerce Pages Phones Only
- WordPress Development Workflow
- Woocommerce redirection product_name -> product_cat/product_name
- Remove Stripe Woocommerce Credit Card Icons (and replace with image)
- How to add external product url to woocommerce from a metadata by function.php
- Unable to call woocommerce hook in my custom php file
- Custom account page that accepts a query parameter
- Custom WooCommerce template for product
- Checkout fr Woocommerce – load default WooCommerce checkout template on the fly
- Loop Through Current Woocommerce Product Categories Sub Categories
- Two types of product categories on shop page
- Remove username and account password field from checkout page
- How to send an invoice with details to the customers
- HTTP Error when uploading pictures and problem with the size of images
- add_rewrite_rule() returns 404 page
- How to change “add to basket” button text in WooCommerce based on product category?
- Woocommerce Setup not completing
- WooCommerce – Adding Product Attributes to CSV Export
- Unable to enocde the result of wc_get_products
- Woocommerce Add to Cart function
- WooCommerce – doesn’t show product when using woocommerce.php [closed]
- Remove Span Class From Woocommerce Price
- Notice: Trying to get property of non-object in bodycenter [closed]
- WooCommerce remove billing detail completly
- unable to get product by category only getting product added lastly
- registration_errors not working
- Translate Woocommerce tab
- Woocommerce -> gallery images per variation without a plugin? [closed]
- Why is my WordPress admin not working
- Create bookings after subscription renewal
- Change variants URL
- Use a woocommerce hook to create a table and populate it with a query