Hi, I would like to add a shortcode in my wordpress site where inside a child theme file I create a dedicated CTA.
To do this I inserted the following code in the function.php file:
function fn_manutenzione() {
$ctamanutenzionewordpress = include('cta-manutenzione-wordpress.php');
}
add_shortcode( 'cta-manutenzione-wordpress', 'fn_manutenzione' );
Subsequently, in the cta file, named cta-manutenzione-wordpress.php, I inserted the following text:
<div class = "text-container"><p style = "color: # 000;"> CTA Text </p></div>
Why now if I add the shortcode [cta-manutenzione-wordpress] it shows me the text twice but only at the top of the article and not where I inserted the shortcode?
Hey Mickyhood,
Maybe it would be better if you create a custom element instead? https://kriesi.at/documentation/enfold/custom-element-templates/. Then you won’t have to work with custom shortcodes.
Best regards,
Rikard