• Resolved catmaniax

    (@catmaniax)


    Hello.

    I’m trying to add a shortcode in the footer but it its content does not appear, all I get is an empty shortcode, for example [myshortcode]

    I think I’m doing something wrong, can you please explain how I can place a shortcode in the header or footer?

    Please let me know.
    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You have to use PHP.

    <?php
    
    // Use shortcode in a PHP file (outside the post editor).
    echo do_shortcode( ' [ my_shortcode ] ' );
    	
    // In case there is opening and closing shortcode.
    echo do_shortcode( '[iscorrect]' . $text_to_be_wrapped_in_shortcode . '[/iscorrect]' );
    	
    // Enable the use of shortcodes in text widgets.
    add_filter( 'widget_text', 'do_shortcode' );
    	
    // Use shortcodes in form like Landing Page Template.
    echo do_shortcode( '[contact-form-7 id="91" title="quote"]' );
    	
    // Store the short code in a variable.
    $var = do_shortcode( '' );
    echo $var;
    
    ?>

    You’re Welcome! ??

    Thread Starter catmaniax

    (@catmaniax)

    Thanks for the reply.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add shortcodes?’ is closed to new replies.