I want to insert PHP code into my posts and pages.
How do I do this? Is there some native functionality, or some plugin?
I want to insert PHP code into my posts and pages.
How do I do this? Is there some native functionality, or some plugin?
Thanks.
Blah, choices :( Which of these is better/easier, and which is used by more people?
Perhaps you could try one and see how it goes, judge it for yourself. Just a thought:)
Yes but with these things, there's almost always minor little issues that you never find out about until it's too late.
It would probably be tough to switch from one to the other down the line, and I see no real reason to prefer one over the other right now. Just looking to get some insight from anybody with more experience :)
Well I ended up going with exec-php, and one of those minor little issues is the wpautop filter. I found that one should use the Disable wpauto plugin (http://wordpress.org/extend/plugins/disable-wpautop/) if embedding php code.
As well as disabling the WYSIWYG editor (Users->Your Profile), otherwise it'll keep escaping your <?php ?> tags.
I too use exec-php. I tried one of the other ones (I don't remember which) and it wasn't compatible with the "email this" and "print this" plugins I have installed; users were getting the PHP code emailed and printed, instead of the output of that code. I asked the email/print plugin author why, and he said I wasn't using a "proper" PHP plugin. I switched to exec-php and it works fine.
This topic has been closed to new replies.