External products in WooCommerce are instances of WC_Product_External
class. This class has public get_product_url()
method which you can use to receive external URL.
So you need to get (current) product and call that method to get URL. After it you can use that URL in your template to wrap an image or something else.
/**
* Your custom template
*/
global $product;
?>
<div>
...
<a href="https://wordpress.stackexchange.com/questions/128534/<?php echo esc_url( $product->get_product_url() ) ?>"><img ...></a>
...
</div>
Related Posts:
- How to add an image from web-link?
- How can I make add_image_size() crop from the top?
- Is it possible to “freeze” a WordPress blog?
- How to Delete All regenerated thumbnails but keep the original ones?
- How to upload image with simple form?
- Using Advanced Custom Fields with WordPress and Lightbox
- Way to force media uploader use custom image size
- A plugin for having rel=”nofollow” in posts?
- How to set all external links to a certain domain to “nofollow”?
- Use Media Uploader in Plugin
- Conditional Display of Links in Widgets
- How to add nofollow on all external links without plugin?
- Upload images from custom plugin using the media modal
- resize only height using wp_get_image_editor
- Get uploaded image url
- Layout shop page: resize images and columns
- How to crop image from center using wp_image_editor
- How to show category images (from plugin) on a regular page (page-example.php)?
- Saving/Writing/Adding file to upload folder
- How to limit 1 image per post on homepage only?
- Flickr plugin that will display photos from multiple group pools? [closed]
- How to change ID of an attachment in wp_posts and its related tables correctly?
- Converting Attachment to Images?
- Bulk Image Uploader to create new post from each image [closed]
- Regenerate images with automatic ALT and TITLE attributes
- How to add a random image to a post from gallery and only show one?
- Preview featured image using frontend post plugin
- How to resize images due to container width automatically server side/without CSS
- Set featured image randomly from WordPress Database on post submission
- How to create a managed image repository in wordpress
- wp_generate_attachment_metadata is creating an empty array
- Contact Form 7 Get Image Function [closed]
- How generate 200% image size and save with suffix @2x
- How to upload WordPress Images to remote web server and display those images in WordPress gallery [closed]
- Retrieving Meta from Image Attachment
- How to upload multiple files/images when developing a wordpress plugin?
- Implementing an image hosting website using WordPress? [closed]
- How to apply lazy loading in background images [closed]
- Woocommerce showing images blurry in description page
- Plugin to hide image in excerpt
- Image change on hover
- How to write “alt” tag in image for wordpress code?
- Getting taxonomy images to display on single-post with their terms
- Image crop, resize and compression plugin?
- How to Resize the Custom Post Images?
- Plugin that will let me specify a number of image sizes?
- Images under 1MB are not being compressed
- Clear out old images, any advice?
- Large amount image data transfer
- Get Image Having the ID [closed]
- Overwrite add_image_size defined by theme
- Scrape a webpage for image and add it to post
- How to auto strip hyperlinks & images in wordpress post
- Add_image_size not generating correct size
- Is there a Image Gallery which will load all my posted Images like twitter’s image grid?
- Offer Download Links for Product Images
- Why the internal link get converted into a comment?
- Bulk Image Resize for Media Library, but for ENLARGING instead of Shrinking
- Optimal image size for wordpress?
- Copy/paste local images not working in WordPress
- How to add height and width to images on a page(using WP Bakery) to improve Google’s CLS score?
- Get all image in media Gallery with alt/title?
- WordPress built-in compression of images? How well does it compare to Photoshop or Shortpixel?
- Is there a way to auto generate poster image for videos
- Do images in plugins automatically load?
- I need to register and resize images, safe to delete plugin afterwards?
- .com creates automated link in post
- WP_get_image_editor resizing images in a foreach loop
- Scroll to ID broken in main menu
- Implementing Scrollable Images
- Remove special characters from filenames
- Looking for Image Slider that is based on default WP Media Library
- How to make cover image in post block expand to entire screen?
- flip horizontal images in bulk
- How to Display image from Menu Image in Walker Dropdown Select Menu
- Add Filter to get_next_posts_link
- Is there any hook to change media html in post? [duplicate]
- export high ress images to pdf
- Any way to edit/crop my featured image upon uploading?
- adding image in the header of my dev widget
- How to show post attachment image
- How to Set Limit with WordPress Get Bookmarks Shortcode
- Advanced Custom Fields (ACF) Plugin – Random Image in Sidebar
- Retrieve post thumbnails
- Images not showing and plugins not installing on wordpress server move
- How to remove links generated by SEO-smart-links?
- Make a wordpress site similar to Hot Or Not – Image rating system [closed]
- Any plugins that upload, resize, and display images? [closed]
- Displaying single Instagram images as a tile
- How can I server scaled images?
- Adding hero images to blog posts
- Is there a WordPress Plugin like Imsanity that keeps high resolution originals? [closed]
- HTML link within my plugin settings page
- how to add “alt” for all image in wordpress
- How to make temporary expiring link for a downloadable file
- WordPress Customise
- Images get uploaded itself from the computer
- Achieve the following layout
- claim a permalink and all sublinks in plugin
- How To Convert External Image URLs To Own Website’s Uploaded Images Automatically?