
If you are still struggling on how to insert PHP Codes inside particular blog post, page or a widget sidebar for execution; the following tutorial is for you.
Executing PHP codes in Wordpress Page/Post
Installation
- Download phpexec.txt
- Rename phpexec.txt to phpexec.php
- Upload to /wp-content/plugins/ directory
- Activate the plug-in from Wordpress administration menu
Usage
Anywhere in your post/pages where you want to execute a PHP Codes, insert <phpcode> before your php codes and </phpcode> your php codes.
<phpcode>
<?php
echo "Current date and time: ";
echo date("l dS of F Y h:i:s A");
?>
</phpcode>
Security
If you are running a blog with multiple users, you need to determine who can run this plug-in. Alter the settings in your Administration Menu. Options -> PHPExec
Executing PHP codes in Wordpress widget sidebar
Installation
- Download execphp.txt
- Rename execphp.txt to execphp.php
- Upload to /wp-content/plugins/ directory
- Activate the plug-in from Wordpress administration menu
Usage
This plug-in work like a normal text widget except that it allows execution of PHP Codes. You can create up to 9 instances of this widget.
Related Contents |
Sponsors |
|
Posted by hongkiat in Wordpress, Wordpress Plugin , at 02.18.07
|
|























Comments
CincauHangus February 18th, 2007
does it work with other wysiwyg editors like xinha4wp ?
Replyhongkiat February 19th, 2007
Hm, I don’t think it will work in any WYSIWYG textbox. What you put in WYSIWYG is what you will see for output.
I’ve never used xinha4wp before, not really planning to use WYSIWYG to write my entries :)
ReplyCincauHangus February 19th, 2007
what i meant was using a wysiwyg editer, switch to see the html coding, then add the code there. would it still work? because there’s some editors that will discard unrecognised tags when posted… therefore the code wouldnt work.
aah. a html coder i see :P i’m somewhat in between. :P
Replyhongkiat February 20th, 2007
Yeah, that’s what i mean :) Me using the coding mode, the tag works fine.
ReplyAshish Mohta February 20th, 2007
I ad been using the plugins from long time.But never used them inside the post.I am not able to understand what i can run inside my post.
Replyhongkiat February 26th, 2007
One good example would be Alex King’s popularity content plugin where you need to put “Top X Popular Content” on your sidebar. It requires phpcode, there’s where this sidebar php-insert comes in handy :)
ReplyThilak March 2nd, 2007
I had been using this while i was on Wordpress 1.5.x, but does it work with Wordpress 2.1.1 now ??
Replyhongkiat March 3rd, 2007
I’m still on WP 2.1. Are you sure it will not work with WP2.1.1? Hmm, something I should put on check list before upgrading.
ReplyAntonie Potgieter March 3rd, 2007
I’m using WP2.1.1 and it doesn’t seem to work.
ReplyIs there an alternative method to this?
Steven Sashen March 4th, 2007
I’m using 2.1.1 and I can’t get it to work either… what I see is the php code (but note the tags)
Am I doing something wrong?
Replyhongkiat March 4th, 2007
It is working for Wordpress 2.1.0 but however I noticed few saying its not working for Wordpress 2.1.1. I’ll update here once the authors have updated their plugins.
Replyroyalblogger March 14th, 2007
Same here, not working with 2.1.1.
ReplyGary Speer April 9th, 2007
Anybody found out more about getting the execphp widget to work in WordPress 2.1.3?
I can’t get it to do anything but display the php code or give me an error related to line 24, I think it is.
Any help? Hope? (grin)
Replystephen April 12th, 2007
i haven’t tested this yet, but for you 2.x.x+ users, try out this link here
http://activeblogging.com/info/phpexec-2/
Replyblogger tools April 22nd, 2007
Exactly what I was looking for.
I need to include a php script in my pages.
I hope this plugin will be updated for the latest and coming versions of wordpress.
and thanks for making life easier for us wordpress bloggers ;)
Replynazlihaffiz May 6th, 2007
i’m using 2.1.3 in my other website at http://www.drnazlihaffiz.com and found that phpexec wasn’t working.
the fact is it is working, only that you don’t have to type and all that. just put in your codings into the post but remember to edit the post in the code tab (not visual).
hope this helps.
cheers ;)
ReplyTed July 8th, 2007
Thanks, worked a treat.
ReplyPatu July 29th, 2007
Hi, phpexec-2 dont work with wp 2.2.1 :(
Help!!!
Replysealinda December 3rd, 2007
Thanks so much for these codes, they are the way out for me!!! thanks!
ReplyDan Kelly December 14th, 2007
I love the simplicity of your script…
It would be better if it actually worked for me. :-(
I’m using the latest version of WordPress – 2.3.x.
And, when I use the “Code” tab (even when I turn the visual editor off) and ender the following:
In my post, I see:
Any ideas on how to get it to work with wp v2.3.x?
Thanks!!
ReplySherry March 3rd, 2008
Thank you so much for this. I was going nuts trying to find out how to get php to work in my custom plug-ins. Your code is essential, in my opinion! I will definitely support your site and will be back in the future.
ReplyAlfie May 12th, 2008
Will it work on WP 2.5?
ReplyAntonJamm May 13th, 2008
Unable to get working on v2.5, looking at RunPHP right now
ReplyJudah Mu June 5th, 2008
Is php’s:
Replyinclude_once (’/myOther.php’); supported in pages and posts? Can’t seem to get it working… Other php functionality is working on WP2.1.2
Steven June 24th, 2008
My phpcode function stopped working!! It was working perfect on WP 2.5.1 :(
I deactivated all plugins but phpexec, re-uploaded the script but nothing seems to help.. code is visible in posts :( Managing pages was saved in HTML-view. I host my own WP so have full control. What else can I try? Really need help on this.
Replypaul mall June 26th, 2008
I have had some bugs in zended php files that prevented my site from running properly.
I finally found a program that can decompile the zended script. The website is for site owners who have lost their source code.
http://www.decode-zend-decoder.com
Hope this helps someone who is stuck like I was.
ReplyMario August 16th, 2008
Hello, not working at all for me with the following query in wp 2.5.1
posts
LEFT JOIN $wpdb->postmeta ON($wpdb->posts.ID = $wpdb->postmeta.post_id)
LEFT JOIN $wpdb->term_relationships ON($wpdb->posts.ID = $wpdb->term_relationships.object_id)
LEFT JOIN $wpdb->term_taxonomy ON($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)
WHERE $wpdb->postmeta.meta_value = 'Arezzo'
ORDER BY $wpdb->postmeta.meta_value ASC
";
$pageposts = $wpdb->get_results($querystr, OBJECT);
?>
<div class="post" id="post-">
<a href="" rel="bookmark" title="Permanent Link to ">
Sorry, but you are looking for something that isn't here.
Any idea?? Thanks
ReplyMario August 16th, 2008
Mmmmhhh the code in my prev comment got cut out…hope you get the whole deal on the admin side
ReplyPinara.Net August 29th, 2008
That plugin is save?
ReplyJas September 5th, 2008
Amazing Plugin and want to let you know its working with Wordpress 2.6 Also :)
ReplyJas September 5th, 2008
Hi,
:( It was running from my cache, but got a nice solution! Chec this:
Replyhttp://www.free-mobile-4u.co.uk/wp-content/plugins/exec-php/docs/readme.html#tag_balancing
Danno September 17th, 2008
Excellent plugin. Thanks so much. Workin’ just fine here on 2.6.2.
ReplyLarry Bradshaw September 19th, 2008
I tried this and still got nothing but text on my page.
ReplyMaclin September 25th, 2008
hi,
Replyits good site
Steve Rial October 3rd, 2008
It worked absolutely perfectly and was exactly what I needed. Thanks for the good work.
Replymommaroodles November 6th, 2008
Hi
Just wondering if you could help me with something please. I am a bit of a WP newbie and not too good with PHP. If I wanted to write a page and include a particular post from a category, how would I include that. I know that I would have to find the post ID but and have been trying a couple of edits, but am not getting it right. I’d be very happy if you could show me how its done, if it can be done!
Rgds :)
ReplyGalwin December 12th, 2008
Cool! I really helps!
ReplyDave Hassen January 27th, 2009
Doesn’t seem to work on 2.7.
All I get in my post (using your sample php up there) is the markup displayed on the screen.
ReplyAlvyn K February 4th, 2009
Well, I guess I had just found the answer to most your problems listed here.
I tried execphp.php as well, but it didn’t work on WP 2.7. So I copied the whole of my php file (AC Image/Text Slider) into the “ad unit” under post. Import it as ad unit then insert into post / page.
Wa lah! It appeared nice and fine.
You can check it out here http://www.alvyncool.com
ReplyAmit Banerjee February 4th, 2009
Doesn’t works for me Either……I am using Wp-2.7
It would be Nice of you to fix the plugin for 2.7
Thanks
ReplyVacom February 7th, 2009
Yahhh…same too me! Not work with Wp-2.7
ReplyKarl February 10th, 2009
It works fine for me in the sidebar. After installing and activating the plugin, can add php code to the “Text” box in the sidebar and it works fine.
ReplyLink February 14th, 2009
This plugin can execute PHP code only for registered user – administartor. But what I need to do for working it for non-registered users? If I have 5-10k users daily… I downloadd Role-Plugin – and can`t nothing to do.. Help :)
Replyyo February 26th, 2009
thanks a lot man. huge help. been lookin for this for a while
Replywheelf March 4th, 2009
+1 к предыдущему комментарию
ReplyAnne March 5th, 2009
amazingly easy !
ReplyThanks.
Arun Sukumar March 7th, 2009
Hi Brother,
ReplyThanks for the plugin, Keep producing :)
Bayu Hendra Winata April 2nd, 2009
works for me, thanks
ReplyMCA April 25th, 2009
hi dude,
Replythis is awesome, thanks!
nuague April 27th, 2009
Ага, теперь понятно…А то я сразу не очень то и не понял где тут связь с самим заголовком…
ReplyFafSceva May 14th, 2009
Спасибо вам за сайт, очень полезный ресурс, мне очень нравится
Replyвебмастеру May 26th, 2009
Никогда не спорьте с умным: люди могут не заметить между вами разницы!
ReplyTreldbede May 27th, 2009
Камрад убей себя=)
ReplyTreldbede May 27th, 2009
Спасибочки:) Классная тема, пишите чаше – у вас отлично получается =)
ReplyTreldbede May 27th, 2009
Как обычно, вебмастер грамотно опубликовал!=)
ReplyTreldbede May 27th, 2009
Полностью с Вами согласна, примерно неделю назад написала про этоже в своем блоге!=)
ReplyTreldbede May 27th, 2009
Приветики! Читаю не первый день странички. Да вот скорость соединения хромает. Как можно подписаться на вашу RSS-ленту? Хотел бы читать вас и дальше.:-)
ReplyTreldbede May 27th, 2009
Я подписался на RSS ленту, но сообщения почему-то в виде каких-то иероглифов :( Как это исправить?!
Replyфорум фанов May 27th, 2009
Недавно наткнулся на форум фанов, там действительно есть что почитать
Replyсрочный выкуп автомобиля May 29th, 2009
Производим срочный выкуп иномарок
Replyинтернет аукцион монет June 2nd, 2009
До сих пор ищите где продать? Тогда специально для вас наше предложение – интернет аукцион Украины
Replyозеленение June 2nd, 2009
Заходи к нам и мы раскажем тебе про правильное озеленение
Replyлюбовь June 2nd, 2009
Очень важный момент в жизни каждого человека – это зачатие; )
Replyздоровье June 2nd, 2009
Отличный пост, но помните что здоровье важнее всего
Replyотделка June 3rd, 2009
В принципе интересные проекты
Replyсмотреть видео June 3rd, 2009
Чем мельче интересы мужчины, тем крупнее кажется ему каждая мелочь.
Replyoricluber June 6th, 2009
oriclub
Replyhaungo June 26th, 2009
Thanks! works awesome !
Replyyour ip address July 2nd, 2009
Do you want know your see request variables – for free?
ReplyGEO base services July 2nd, 2009
Cool servise – Trace ip tools
ReplyTrackbacks