Title: text editor doesn&#039;t read php code
Last modified: August 22, 2016

---

# text editor doesn't read php code

 *  [marner](https://wordpress.org/support/users/marner/)
 * (@marner)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/text-editor-doesnt-read-php-code/)
 * Hi all,
 * I’m converting my existing site in wordpress theme and I copy pasted some html
   codes in wordpress text editor and everything displays as it supposed to but 
   when I write php code in my text editor it doesn’t read it as php code.
 * for example, I have this image with a link
 * **`<a href="#"><img src="http://localhost/wordpress/wp-content/themes/1000MilesBand/
   images/eng_flag.jpg" alt="english flag" /></a>:` **
 * and when I add php code to open a specific wordpress page when clicked:
 * **`<a href="<?php echo get_permalink(get_page_by_title('About'));"><img src="
   http://localhost/wordpress/wp-content/themes/1000MilesBand/images/eng_flag.jpg"
   alt="english" /></a>`**
 * the image disappears…
 * but this code actually works in my header.php file, it only does not work when
   I write it in wordpress page text editor window,
 * any ideas?

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

 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/text-editor-doesnt-read-php-code/#post-5484649)
 * [http://codex.wordpress.org/Writing_Code_in_Your_Posts](http://codex.wordpress.org/Writing_Code_in_Your_Posts)
 * see if any plugin can work for you. for example: [https://wordpress.org/plugins/advanced-code-editor/](https://wordpress.org/plugins/advanced-code-editor/)
 *  Thread Starter [marner](https://wordpress.org/support/users/marner/)
 * (@marner)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/text-editor-doesnt-read-php-code/#post-5484651)
 * Thanks for your reply, I guess wordpress doesn’t not support php codes in their
   text editor by default, which is very inconvenient

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

The topic ‘text editor doesn't read php code’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [marner](https://wordpress.org/support/users/marner/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/text-editor-doesnt-read-php-code/#post-5484651)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
