Displaying php in a WordPress page

No Comments

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 >>

This is author biographical info, that can be used to tell more about you, your iterests, background and experience. You can change it on Admin > Users > Your Profile > Biographical Info page."

About us and this blog

We are a digital marketing company with a focus on helping our customers achieve great results across several key areas.

Request a free quote

We offer professional SEO services that help websites increase their organic search score drastically in order to compete for the highest rankings even when it comes to highly competitive keywords.

Subscribe to our newsletter!

Fields marked with an * are required

More from our blog

See all posts