Title: Problem with insert_php and shortcode
Last modified: August 22, 2016

---

# Problem with insert_php and shortcode

 *  Resolved [dpurselle](https://wordpress.org/support/users/dpurselle/)
 * (@dpurselle)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/problem-with-insert_php-and-shortcode/)
 * When I insert shortcode into a page using the Insert PHP plugin, I am getting
   a Parse error:
 * Code on page:
 * [insert_php]
    echo do_shortcode(‘[pdb_list filter=”user_login=’ . $current_user-
   >user_login . ‘”]’); [/insert_php]
 * Page output:
 * Parse error: syntax error, unexpected ‘&’ in /home/content/01/12721101/html/CAG/
   wp-content/plugins/insert-php/insert_php.php(48) : eval()’d code on line 2
 * I can resolve the parse error by changing the multi-level quote structure (see
   below), but this coding does not allow the filtering to work.
 * [insert_php]
    echo do_shortcode(“[pdb_list filter=\”user_login=’.$current_user-
   >user_login.’\”]”); [/insert_php]
 * I have tried using \” and \’ as a the first level quote and ” ‘ as the next 2
   levels, but this does not work either:
 * Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_STRING
   in /home/content/01/12721101/html/CAG/wp-content/plugins/insert-php/insert_php.
   php(48) : eval()’d code on line 2
 * The shortcode as originally written works fine when embedded directly into a 
   custom template. Any suggestions for coding using Insert PHP to avoid having 
   to create a custom template for each new theme I try?
 * [https://wordpress.org/plugins/insert-php/](https://wordpress.org/plugins/insert-php/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [dpurselle](https://wordpress.org/support/users/dpurselle/)
 * (@dpurselle)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/problem-with-insert_php-and-shortcode/#post-5267114)
 * Problem is fixed. There must have been some random characters in the code. When
   I retyped everything from scratch using a text editor, it worked.

Viewing 1 replies (of 1 total)

The topic ‘Problem with insert_php and shortcode’ is closed to new replies.

 * ![](https://ps.w.org/insert-php/assets/icon-256x256.gif?rev=3523853)
 * [Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts](https://wordpress.org/plugins/insert-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-php/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-php/reviews/)

## Tags

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

 * 1 reply
 * 1 participant
 * Last reply from: [dpurselle](https://wordpress.org/support/users/dpurselle/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/problem-with-insert_php-and-shortcode/#post-5267114)
 * Status: resolved