Hello can you help me,
i want to add shortcode after this <div class="customads1"
and <div class="customads2"
this is the complete code i added in the function.php
add_action( 'storefront_footer', 'fuyn_footer_widgets', 11 );
function fuyn_footer_widgets(){
if( is_checkout() ){
global $woocommerce ;
if ( $woocommerce->cart->total != 0 ) {
return;
}
echo '<div class="customads" style="width: 100%;display: flex;">
<div class="customads1" style="width: 50%;background: bisque;margin: 5px;">Shortcode.</div>
<div class="customads2" style="width: 50%;background: bisque;margin: 5px;">Shortcode.</div>
</div>';
}
}
how to do it,
this is my short code
[sc name="ads"][/sc]
Thank you
2
Answers
You can use do_shortcode()
To add a shortcode inside a PHP code on WordPress. You need to use do_shortcode() like this:
You can also structure it better like this:
OR
Note:
do_shortcode()
always requires anecho
.