Title: do_shortcode returning blank page
Last modified: August 30, 2016

---

# do_shortcode returning blank page

 *  Resolved [whitesea](https://wordpress.org/support/users/whitesea/)
 * (@whitesea)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/do_shortcode-returning-blank-page/)
 * Hi everyone,
 * I’m still new to WordPress development so please be kind 🙂
 * I’m using the echo do_shortcode function within my custom template page to call
   the plug-in (I think this is the right terminology…). It’s been extremely finicky.
   I have the shortcodes in a FAQ div with two columns/floated divs. Each FAQ question
   looks like this:
 * `<h3 class="process-title"><?php echo do_shortcode( '[expand title="What kind
   of payment do you accept?"]At the moment we only accept payment by check.[/expand]');?
   ></h3>`
 * The weird thing is, when I add a new question, sometimes it’ll return a blank
   page. But it’s only my website that goes blank, NOT the admin, as is per usual
   with a broken function.
 * Also, it’ll only do this sometimes, and I cannot figure out or predict why it
   chooses to do that, or NOT do that. I copy and paste the exact same line that
   previously worked, and sometimes it’ll work again, and sometimes it’ll go blank.
 * Is it an issue with the function? With my divs? Any idea?
 * Thank you in advance.
 * [https://wordpress.org/plugins/jquery-collapse-o-matic/](https://wordpress.org/plugins/jquery-collapse-o-matic/)

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

 *  Plugin Author [Baden](https://wordpress.org/support/users/baden03/)
 * (@baden03)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/do_shortcode-returning-blank-page/#post-6296162)
 * what editor are you using to edit the template files?
 *  Thread Starter [whitesea](https://wordpress.org/support/users/whitesea/)
 * (@whitesea)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/do_shortcode-returning-blank-page/#post-6296178)
 * Baden, I’m editing the files directly in the WordPress editor. Is this wrong?:/
 *  Plugin Author [Baden](https://wordpress.org/support/users/baden03/)
 * (@baden03)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/do_shortcode-returning-blank-page/#post-6296183)
 * this is very strange. you paste the exact same code and save and _sometimes_ 
   you get a white screen… you might want to set wp_debug to true in your wp-config
   file to see if that gives you any more details on what in the wide-world of sports
   is a’going on.
 *  Thread Starter [whitesea](https://wordpress.org/support/users/whitesea/)
 * (@whitesea)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/do_shortcode-returning-blank-page/#post-6296220)
 * Okay, I set it up and this came back:
 * Parse error: syntax error, unexpected ‘t’ (T_STRING) in **my theme page** on 
   line 86.
 * Any ideas?
 *  Thread Starter [whitesea](https://wordpress.org/support/users/whitesea/)
 * (@whitesea)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/do_shortcode-returning-blank-page/#post-6296221)
 * Hold on, let me find the line in question.
 *  Thread Starter [whitesea](https://wordpress.org/support/users/whitesea/)
 * (@whitesea)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/do_shortcode-returning-blank-page/#post-6296222)
 * Well, I figured it out. Any apostrophes used in the expanded text causes an error.
   Just removed them all and it went back to working.
 * Do you know of any way around this, Baden?
 *  Thread Starter [whitesea](https://wordpress.org/support/users/whitesea/)
 * (@whitesea)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/do_shortcode-returning-blank-page/#post-6296223)
 * I don’t know if I was clear before, but I edit my custom templates in the editor
   under Appearance, not within the page’s text editor.
 * I experimented by using the original shortcode, sans the function, inside the
   actual page’s text editor, and it worked just fine with apostrophes put in.
 * So, the do_shortcode function causes a syntax error when apostrophes are used.
 *  Plugin Author [Baden](https://wordpress.org/support/users/baden03/)
 * (@baden03)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/do_shortcode-returning-blank-page/#post-6296225)
 * can you share an example of how you are using do_shortcode with apostrophes?
 *  Thread Starter [whitesea](https://wordpress.org/support/users/whitesea/)
 * (@whitesea)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/do_shortcode-returning-blank-page/#post-6296229)
 * Example:
 * `<h3 class="process-title"><?php echo do_shortcode( '[expand title="What kind
   of payment do you accept?"]At the moment it's our policy to only accept payment
   by check.[/expand]' ); ?></h3>`
 * The apostrophe in “it’s” causes a syntax error.
 *  Plugin Author [Baden](https://wordpress.org/support/users/baden03/)
 * (@baden03)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/do_shortcode-returning-blank-page/#post-6296230)
 * yes, easy fix: you need to [escape the apostrophes](http://www.homeandlearn.co.uk/php/php7p7.html)
   because php is looking at it as the end of the do_shortcode argument. Try this:
 *     ```
       <h3 class="process-title"><?php echo do_shortcode( '[expand title="What kind of payment do you accept?"]At the moment it\'s our policy to only accept payment by check.[/expand]' ); ?></h3>
       ```
   
 *  Thread Starter [whitesea](https://wordpress.org/support/users/whitesea/)
 * (@whitesea)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/do_shortcode-returning-blank-page/#post-6296231)
 * Baden, thank you!! I didn’t know about that, but it makes total sense.
 * I ended up transferring my template content to the text editor and using `<?php
   the_content(); ?>` to fill it in. Turned out to be a major headache. Wish I would’ve
   waited for your reply! 😛
 * Thanks again, I really appreciate it.
 *  Plugin Author [Baden](https://wordpress.org/support/users/baden03/)
 * (@baden03)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/do_shortcode-returning-blank-page/#post-6296238)
 * Live and learn… we’ll mark the issue as resolved. Hit us back if you require 
   any further assistance. If you like the plugin or the support: why not [vote for pedro](https://wordpress.org/support/view/plugin-reviews/jquery-collapse-o-matic)?

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

The topic ‘do_shortcode returning blank page’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/jquery-collapse-o-matic_fffeff.svg)
 * [Collapse-O-Matic](https://wordpress.org/plugins/jquery-collapse-o-matic/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jquery-collapse-o-matic/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jquery-collapse-o-matic/)
 * [Active Topics](https://wordpress.org/support/plugin/jquery-collapse-o-matic/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jquery-collapse-o-matic/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jquery-collapse-o-matic/reviews/)

## Tags

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

 * 12 replies
 * 2 participants
 * Last reply from: [Baden](https://wordpress.org/support/users/baden03/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/do_shortcode-returning-blank-page/#post-6296238)
 * Status: resolved