Title: PHP being rendered as plain text
Last modified: August 21, 2016

---

# PHP being rendered as plain text

 *  Resolved [Perkin5](https://wordpress.org/support/users/perkin5/)
 * (@perkin5)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/php-being-rendered-as-plain-text/)
 * In order to load an image in a page, I am using <?php echo get_bloginfo(‘template_directory’);?
   > to get the template url but instead of giving me a uri the code snippet is 
   being rendered as plain text. I alsi tried <?php echo ‘TEST’; ?> with the same
   result
 * I’m using the Underscores theme and WAMP as a local server
 * What can be going on?

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

 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [11 years, 11 months ago](https://wordpress.org/support/topic/php-being-rendered-as-plain-text/#post-5094774)
 * In which file are you putting this code?
 *  Thread Starter [Perkin5](https://wordpress.org/support/users/perkin5/)
 * (@perkin5)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/php-being-rendered-as-plain-text/#post-5094799)
 * I entered it in the Page Editor so it would have been put in the database. Is
   there a wp database security setting I wonder to prevent code injection?
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [11 years, 11 months ago](https://wordpress.org/support/topic/php-being-rendered-as-plain-text/#post-5094803)
 * The page editor doesn’t render PHP. Are you creating your own theme?
 *  Thread Starter [Perkin5](https://wordpress.org/support/users/perkin5/)
 * (@perkin5)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/php-being-rendered-as-plain-text/#post-5094809)
 * Yes, I’m creating a theme based on Underscores.
 * If the page editor doesn’t render php, how do I pull in an image from my theme
   image folder? Surely I need to get the theme directory url with a wp template
   tag?
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [11 years, 11 months ago](https://wordpress.org/support/topic/php-being-rendered-as-plain-text/#post-5094810)
 * Generally assets that you’re adding into the page editor should be things from
   the ‘uploads’ directory. Assets from the ‘theme’ directory should be added into
   templates.
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [11 years, 11 months ago](https://wordpress.org/support/topic/php-being-rendered-as-plain-text/#post-5094812)
 * You can edit a template in Appearance > Editor
    _[http://codex.wordpress.org/Appearance\_Editor\_Screen](http://codex.wordpress.org/Appearance_Editor_Screen)_
 *  Thread Starter [Perkin5](https://wordpress.org/support/users/perkin5/)
 * (@perkin5)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/php-being-rendered-as-plain-text/#post-5094839)
 * Ah – new to wp and hadn’t appreciated that.
 * Actually I prepare all content in Subime Text 2 and cut and paste into the Page
   Editor so it’s easy to get carried away?
 * Thanks for responses

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

The topic ‘PHP being rendered as plain text’ is closed to new replies.

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [tag](https://wordpress.org/support/topic-tag/tag/)
 * [underscores](https://wordpress.org/support/topic-tag/underscores/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 2 participants
 * Last reply from: [Perkin5](https://wordpress.org/support/users/perkin5/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/php-being-rendered-as-plain-text/#post-5094839)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
