• Hi

    Can someone please explain me what I need to do, when using plugin shortcodes in theme files. I was reading first I need to install the plugin and then add this function in the file ” do_shortcode(‘[SHORTCODE]’) ” and thats it. But is not working for me. Do I need to do something else? Define this shortcode in other place? I want to insert it in my header file

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Please show some code so we can see what you’re trying to do. Put the code on gist.github.com and put the link here.

    By the way, you need to ECHO a shortcode, so

    <?php echo do_shortcode( '[the_shortcode]' ); ?>

    Thread Starter Fabloria

    (@fabloria)

    Thanks Steve

    This is what Im trying to do:

    if( isset( $textfield[‘input’] )) {
    echo do_shortcode( ‘[PluginShortcode]’ .esc_html( $textfield[‘input’] ).’‘);

    So I’m trying this, if $textfield has a value, it applies the shortcode and prints the value. But is not working.
    The plugin that uses this shortcode is already installed. So PHP should recognize it right?
    Why is not working?

    Thanks

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    where are you putting this?

    Thread Starter Fabloria

    (@fabloria)

    In one of my theme files
    Is supposed to be printed in the header of my website

    Thread Starter Fabloria

    (@fabloria)

    In one of my theme files
    Is supposed to be printed in the header of my website

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Shortcodes’ is closed to new replies.