So my plan was to add custom banner to all pages simply using code in functions.php, it works, but not how I would like to
Code:
add_action( 'woocommerce_after_main_content', 'after_main_content', 1 );
function after_main_content() {
echo ' <style>
.img-container {
text-align: center;
}
</style>
<div class="img-container">
<img src="https://www.prospecs.lt/wp-content/uploads/2020/12/dpdtt-1.png" >
</div>
';
}
Only in pages with sidebars my banner get's allocated to another section.
Any ideas how to place it in the right place on pages with sidebar?
my site: www.prospecs.lt
I suggest, you should use a theme footer action. Which is: ocean_after_main So the code would be:
add_action( 'ocean_after_main', 'after_main_content', 1 );
function after_main_content() {
if( is_shop() ){
echo ' <style>
.img-container {
text-align: center;
}
</style>
<div class="img-container">
<img src="https://www.prospecs.lt/wp-content/uploads/2020/12/dpdtt-1.png" >
</div>
';
}
}