Title: Shortcodes
Last modified: April 19, 2017

---

# Shortcodes

 *  [Fabloria](https://wordpress.org/support/users/fabloria/)
 * (@fabloria)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/shortcodes-263/)
 * 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)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [8 years, 11 months ago](https://wordpress.org/support/topic/shortcodes-263/#post-9046815)
 * 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](https://wordpress.org/support/users/fabloria/)
 * (@fabloria)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/shortcodes-263/#post-9047164)
 * 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)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [8 years, 11 months ago](https://wordpress.org/support/topic/shortcodes-263/#post-9047174)
 * where are you putting this?
 *  Thread Starter [Fabloria](https://wordpress.org/support/users/fabloria/)
 * (@fabloria)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/shortcodes-263/#post-9047196)
 * In one of my theme files
    Is supposed to be printed in the header of my website
 *  Thread Starter [Fabloria](https://wordpress.org/support/users/fabloria/)
 * (@fabloria)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/shortcodes-263/#post-9047197)
 * 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.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 4 replies
 * 2 participants
 * Last reply from: [Fabloria](https://wordpress.org/support/users/fabloria/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/shortcodes-263/#post-9047197)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
