Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1291564

    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?

    • This topic was modified 3 years, 7 months ago by Mickyhood.
    #1292059

    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

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.