Home > Web Tutorials > Displaying php in a WordPress page

Displaying php in a WordPress page

Written by | June 25th, 2008
View the conversation - Join the chat -

I spent a few hours this morning updating and upgrading a clients blog. Thinking it would be nice to add in a pull of their images from Flickr I dutifully downloaded a plugin from lukeh.com. After installing the plugin I decided to add it to a page within the page of the website design rather than the sidebar.

This is where the fun began…

Having never attempted this before I was unaware that PHP code within a WordPress page or post would not execute in the same was as it will from the template page or sidebar without a little extra help.

After a ‘tiny bit’ of searching I found the following plugin from Bluesome called Exec-PHP. This nifty little plugin executes code inside posts, pages and widgets by wrapping the whole text in <?php> tags and then passes it over to the PHP eval() function so no parsing of the code is done by the plugin itself.

It was so simple to use and solved my poblem within 5minutes so I felt I had to share it – tutorial can be found here >>

If you enjoyed this post then why not share it:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Faves
  • StumbleUpon
  • Symbaloo
  • LinkedIn
  • MisterWong
  • email
  • Reddit
  • Simpy

Related posts:

  1. WordPress 2.8 – I Like!
  2. WordPress 2.7 – First Impressions
  3. WordPress ’3 point Oh!’ – first thoughts.

Web Tutorials ,