Hello again,
I have a display issue with the Store Notice (Customizing ->WooCommerce->Store Notice) located at the top of the website in both version (desktop and Mobile version). Clearly, the notice is hiding the header instead of being displayed on top of it. Is there a way to solve this please?
Thanks for your help
Hey rubenhazan2020,
Are you referring to the bar at the top of your site with the following text?
Livraison gratuite pour toute commande superieure a 100 euros Dismiss
If so, then where would you like to place it?
Best regards,
Rikard
Hi,
That element is a notification which can be dismissed. We can give you CSS to move the header down below it, but then there would be space left when it’s dismissed/removed.
Best regards,
Rikard
Hi,
Please try to add this to Quick CSS:
#wrap_all {
margin-top: 41px;
}
p.demo_store {
top: -10px;
}
Then add this function to remove the top margin after the notice has been clicked:
function ava_remove_top_margin(){
?>
<script>
jQuery(document).ready(function(){
jQuery("a.woocommerce-store-notice__dismiss-link").click(function(){
jQuery("#wrap_all").css('margin-top', '0');
});
});
</script>
<?php
}
add_action('wp_footer', 'ava_remove_top_margin', 999);
Best regards,
Rikard
Hi,
I added the function to your functions.php file, and it’s working as it should. Please note that the function will be overwritten on updates, unless you put it in a child theme.
Best regards,
Rikard