WordPress Plugin To Run PHP Scripts In Pages And Posts
Posted by tech on
November 26, 2008
There may come a time wherein you will need to have php code run within your posts and pages in your wordpress blog. Luckily there are some plugins available that will let php code get executed within the page or post. Problem is, not all of them worked for me. I tried ExecPHP and runPHP but both of them did not work.
PHP-Exec did the job for me. You can get it here. Remember, take not of the plugin name. It’s PHP first, then Exec next. The plugin Exec-PHP is different. To use PHP-Exec, you would need to add the following tags <phpcode> and </phpcode> between your <? and ?> php code tags.
To use it, say, listing your categories in a page, do the following.
1 | <phpcode><?php wp_list_categories(); ?></phpcode> |











November 26th, 2008 at 1:51 am
wew… nice tutor here. i try
November 26th, 2008 at 8:12 am
I am planning to create a business website in wordpress, will you help me if I need some help?
Money Journal
Blogger”s Recollections
November 26th, 2008 at 7:40 pm
no problem tey, im not much of a wordpress expert but if i know the answer to your problem, no probs
November 29th, 2008 at 3:55 am
Well thanks for the info Tech, but I tried & failed ye again
All I got was the php code showing in the post.
I’ve tried php exec & exec php but still no good.
Any ideas would be greatly appreciated as it’s giving me a damned headache !!!
Regards Steve
November 29th, 2008 at 4:14 am
that’s odd. it should work. check out my categories page. i used php-exec for that. i created a page first, then placed the code there.
did you activate the plugin? you have to activate it first
November 29th, 2008 at 4:15 am
oh yes. when you do add the code, make sure it is in HTML mode. click the HTML tab
December 23rd, 2008 at 7:06 pm
gak bisa mas !!
- plugin dah aktif
- di post / page gak bisa
- Visual/HTML mode ==> tetep gak bisa
- ==>Gak bisa
- ==>Gak bisa
trus biar bisa gimana ?
btw aku pake WPMU 2.6.5
thanx
May 26th, 2010 at 1:40 am
Thanks for the tip! Exactly what I was looking for !
May 26th, 2010 at 1:46 am
you’re welcome. please do rate this post and follow me in google connect and my rss feeds
July 18th, 2011 at 4:23 am
Hello Friend,
I have use this code but it not working.
July 18th, 2011 at 9:21 am
@suryakant: i did not have problems with it. there must be something lacking with what you are doing