I need to run PHP inside a Word Press Page/Post WITHOUT use of an additional plugin or editing the WP code. Is it possible?
Well if you have access to php.ini (aka if you've got a VPS, or a dedicated server, or even just normal accounts for some hosts with custom control panels), you could use auto_prepend_file or auto_append_file (see http://www.php.net/ini.core at about half way down) to include a php file at the beginning or end of a page execution. If you're on a typical host's shared hosting account with cpanel though, I'm pretty sure you won't be able to make a custom php.ini - in this case your best chance could be to put an include()/require() statement in a file that is always included (perhaps config.php, assuming you don't need any info about the page content from wordpress), requiring minimal change of the wordpress code. You could make a script to be run when a new wordpress version is installed, that adds an include statement to the bottom of config.php or any file like it. The script should look something like this: <?php $fileIncludePath = 'PATH TO FILE TO REQUIRE() IN MODIFIED FILE HERE'; $fileEditPath = 'PATH TO FILE TO CHANGE HERE'; file_put_contents($fileEditPath, '<?php require('.$fileIncludePath.'); ?>', FILE_APPEND) or die("Addition Failed!"); ?> PHP:
You shouldn't need access to php.ini. You should be able to do something like this in .htaccess: <FilesMatch "\.(php)$"> php_value auto_append_file "/your/script.php" </FilesMatch> PHP: This will only work if your host allows your .htaccess to overwrite the httpd.conf file.
Create a page template with your php code. (You can probably copy page.php or single.php and create a template from that.) Next on your post/page editing page, associate your template with that post/page.