Add functions for specific product
-
Hello i use this code to put a badge under featured image but i like to restricte to not display for some specific prouct ID.
This is my start code and function good
function skyverge_add_below_featured_image() { echo '<h4 class="targhettaprodotto" style="text-align:center;margin-top:10px; background: #c2d69a; padding-top: 8px; padding-bottom: 8px; max-width: 80%; margin:auto; margin-top: 2%;">Targhetta INCLUSA nel prezzo</h4>'; } add_action( 'woocommerce_product_thumbnails' , 'skyverge_add_below_featured_image', 9 );
If i try to add
if ( !is_product_ID(868) ) {
function skyverge_add_below_featured_image() {
echo ‘<h4 class=”targhettaprodotto” style=”text-align:center;margin-top:10px; background: #c2d69a; padding-top: 8px; padding-bottom: 8px; max-width: 80%; margin:auto; margin-top: 2%;”>Targhetta INCLUSA nel prezzo</h4>’;
}
add_action( ‘woocommerce_product_thumbnails’ , ‘skyverge_add_below_featured_image’, 9 );
}Not work. Anyone can help me?
Thanks
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Add functions for specific product’ is closed to new replies.