I try to put a Presentation image on my ecommerce web page by follow the instructions of a Woocommerce Course, the Course tell me to use a hook that exist on the homepage template on this way:
<?php
/**
* Functions hooked in to homepage action
*
* @hooked storefront_homepage_content - 10
* @hooked storefront_product_categories - 20
* @hooked storefront_recent_products - 30
* @hooked storefront_featured_products - 40
* @hooked storefront_popular_products - 50
* @hooked storefront_on_sale_products - 60
* @hooked storefront_best_selling_products - 70
*/
do_action( 'homepage' );
?>
So I created a Function on my functions.php from my child theme and adding to the hook with add_actin like that:
//Add Image to the HomePage
function coupon_image() {
$img = '<div class="coupon">';
$img .= '<img src="' . get_stylesheet_directory_uri() . '/img/Logo.jpg">';
$img .= '</div>';
echo $img;
}
add_action('homepage', 'coupon_image', 5);
But the HTML elements are not displayed at all on my homepage, what I do wrong? Even if I do the thing more simple like that:
function coupon_image() {
echo 'Hello';
}
Still doesn’t display nothing on my main page.