Skip to content

Instantly share code, notes, and snippets.

@harishankerr
Created April 23, 2020 04:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harishankerr/d568eae1fd1d5f3c510ab8bc5256b4cd to your computer and use it in GitHub Desktop.
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 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