Created
April 23, 2020 04:59
-
-
Save harishankerr/d568eae1fd1d5f3c510ab8bc5256b4cd to your computer and use it in GitHub Desktop.
Add custom images (e.g. A Secure Checkout image) to the bottom of your Single Product Pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This snippet helps you add custom images (like "Secure Checkout") to single product pages. You can add it to your site at the bottom of your theme's `functions.php` file, or by using a Code Snippets Plugin: https://wordpress.org/plugins/code-snippets/ | |
The end result would look like this: https://d.pr/i/nUk1Bm | |
*/ | |
function woo_add_security_image() { | |
echo '<img src="https://example.com/security-image-url.jpg" />'; // Replace the URL here with the URL of your image. | |
/* Remove the `//` Comments and update the URL(s) below if you would like to add multiple images to your single product page */ | |
// echo '<img src="https://example.com/security-image-url_1.jpg" />'; | |
// echo '<img src="https://example.com/security-image-url_2.jpg" />'; | |
} | |
add_filter( 'woocommerce_product_meta_end', 'woo_add_security_image' ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment