Title: External shortcode not displaying correctly
Last modified: December 14, 2016

---

# External shortcode not displaying correctly

 *  Resolved [minimals](https://wordpress.org/support/users/minimals/)
 * (@minimals)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/external-shortcode-not-displaying-correctly/)
 * Hi,
    I use Tailor normaly, but for example when I put a external shortoce… like
   this _pluginindex.php_
 *     ```
       function wp_first_shortcode()
       {
           echo "Hello, This is your another shortcode!";
       }
       add_shortcode('first', 'wp_first_shortcode');
       ```
   
 * I use [first] on any page and show correctly the print, but when I use on page
   with Tailor, the content broke and the preview mode show `The template for view579
   could not be refreshed`. How can I fix this?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Andrew Worsfold](https://wordpress.org/support/users/andrewworsfold/)
 * (@andrewworsfold)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/external-shortcode-not-displaying-correctly/#post-8564901)
 * Hi [@minimals](https://wordpress.org/support/users/minimals/) –
 * When you add the shortcode, are you using a self-closing version (i.e., [first/])
   or, as you suggest above, [first]?
 * Is anything showing up in the console (right click on the page > Inspect) when
   this happens?
 * Cheers,
    Andrew.
 *  Thread Starter [minimals](https://wordpress.org/support/users/minimals/)
 * (@minimals)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/external-shortcode-not-displaying-correctly/#post-8575463)
 * Hi Andrew,
    If use only [first] or [first][/first], when I inspect the page, 
   the shortcode is printed outside the tailor div. The way I have found to solve
   this issues was add this:
 *     ```
       function wp_first_shortcode()
       {
           ob_start(); // add this
           echo "Hello, This is your another shortcode!"; // do something
           return ob_get_clean(); // and this..
       }
       add_shortcode('first', 'wp_first_shortcode');
       ```
   
 * With this tow lines, the tailor preview works correctly and the shortcode prints
   inside the div.
    Thanks anyway!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘External shortcode not displaying correctly’ is closed to new replies.

 * ![](https://ps.w.org/tailor/assets/icon.svg?rev=1417317)
 * [Tailor Page Builder](https://wordpress.org/plugins/tailor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tailor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tailor/)
 * [Active Topics](https://wordpress.org/support/plugin/tailor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tailor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tailor/reviews/)

## Tags

 * [print](https://wordpress.org/support/topic-tag/print/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 2 replies
 * 2 participants
 * Last reply from: [minimals](https://wordpress.org/support/users/minimals/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/external-shortcode-not-displaying-correctly/#post-8575463)
 * Status: resolved