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?
- wp.media.view.ImageDetails – Save settings as HTML5 data-* attributes for image
- how to get path to images in the uploads folder to be used in a plugin
- How to custom crop each image size?
- Is it possible to “freeze” a WordPress blog?
- How to Delete All regenerated thumbnails but keep the original ones?
- How to generate expiring URL?
- How to upload image with simple form?
- Resizing all images
- Using Advanced Custom Fields with WordPress and Lightbox
- Display (and manage) webcam images?
- Way to force media uploader use custom image size
- Cropping, Re-sizing and Saving images from one folder to another folder in wordpress
- How to make WordPress use protocol indepentent upload files?
- Automatically Import Image into Posts from URLs on the Web?
- Open external links in a new window
- How can I attach images to a post from the media library?
- Issues creating a tinyMCE plugin that creates a custom link
- A plugin for having rel=”nofollow” in posts?
- How do I change the description of the same image which is to be found in multiple instances?
- How to select featured images for 1500 posts?
- Rename existing old uploaded images containing accented French characters (not during upload)
- How to attach Links into page/post or custom post type?
- Thumbnail with different sizes
- How to extract images of post and pages excluding header and logo image in wordpress?
- 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?
- How do I customize my WordPress shortlink structure in link-template.php without a plugin?
- Upload images from custom plugin using the media modal
- Disabling post images for not logged in users
- resize only height using wp_get_image_editor
- How to upload thousands of images?
- Generated Images sizes do not match Media Settings Image Size
- Converting a simple plugin to be placed inside of functions.php
- Get uploaded image url
- There’s some way to add a wrapper around posted images?
- How to get CMB2 to show a single image at a specific size
- 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 Thumbnail size of next Gen Gallery plugin?
- How to remove the whitespace in image name and save the new file
- Tag link suggestion plugin
- Getting media library popup in custom plugin admin page
- How to change ID of an attachment in wp_posts and its related tables correctly?
- How do I create a full-bleed background image on text mouseover? [closed]
- bulk change of image setting “link to” to “link to: image url “
- Converting Attachment to Images?
- Bulk Image Uploader to create new post from each image [closed]
- Regenerate images with automatic ALT and TITLE attributes
- Is it possible to insert images directly from the server?
- How to add a random image to a post from gallery and only show one?
- Get the url of the full sized attachment image using post ID?
- How to add css class to a specific set of images?
- How do I make images clickable so as to enlarge them using lightbox?
- Adding Attachment Display Settings in custom media frame
- Advanced Custom Fields
- Why isn’t “background-image: url”working with Bootstrap carousel on WP?
- Find unused images?
- How to generate video out of images via WordPress plugin
- Image gallery plugin [closed]
- How to upload images to WP Panel keeping correct folder in FTP
- Inserting HTML tag with ACF into shortcode
- Images not showing after changing wp-content folder name
- Preview featured image using frontend post plugin
- How can I implement an Add to Collection function on my Image Gallery to be downloaded later?
- How to Delete all Unused photos Function
- How to resize images due to container width automatically server side/without CSS
- SEO smart plugin not working for words ending with ä, ö, å
- Set featured image randomly from WordPress Database on post submission
- Build a list of partners with Link, Logo and text
- Howto accurately position images with maximum flexibility?
- Show an image in my header.php
- How to create a managed image repository in wordpress
- How can I restrict image upload dimensions for non-admin WordPress users?
- wp_generate_attachment_metadata is creating an empty array
- Force media library editor to overwrite the original filename?
- Contact Form 7 Get Image Function [closed]
- WP Plugin for onpage link suggestions [closed]
- How generate 200% image size and save with suffix @2x
- Load external images via proxy
- Bulk edit WP posts to update embeded images with new alt tags
- How to upload WordPress Images to remote web server and display those images in WordPress gallery [closed]
- Add padding while generating thumbnail
- Can we have an ‘Update metadata’ button in Image Gallery for all image instances?
- Retrieving Meta from Image Attachment
- Add ALT attribute to Pin It Button image to pass HTML5 validation
- Make change in media library affect images in published articles
- How to add subcategories to the blogroll?
- Adding (image) caching to my Tumblr widget
- How to upload multiple files/images when developing a wordpress plugin?
- Image Manager Plugin [closed]
- Implementing an image hosting website using WordPress? [closed]
- Bulk Image Upload And Rerrange Functionality