• I am looking for a plugin that allows this. I have found a few hacks for WP1.2 and prior, but so far nothing I have tried works with WP2.0. Anyone know of any or a way of doing this?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Check this page for compatibility with 2.0:
    2.0 plugin compatibility

    I know these worked in 1.5.2
    PHPExec Plugin
    https://priyadi.net/archives/2005/03/02/wordpress-php-exec-plugin/

    RunPHP Plugin
    https://www.nosq.com/2004/10/runphp-wordpress-plugin/

    Use the second one MichaelH posted, it’s much better! =) That’s coming from experience lol! =)

    spencerp

    Both of these plugins (runPHP and PHPexec) will add <br /> after each line of the includes. I only know this because when I use php include to add a javascript file, all these <br />s get added and ruin the code.

    When I include a PHP file, it just doesn’t work but doesn’t show up in the html code-view.

    As I asked elsewhere, is there a setting for WP I can turn off?

    gmdavis62, so you tried adding javascript to a “page” then, while using one of them plugins? If so, why are you doing that? Those plugins are for using “php” within a page, not javascripts.. :/

    spencerp

    This was supposed to be a feature of WP 2.0. (previously 1.6).
    See Here:
    https://codex.www.ads-software.com/Version_1.6#Pages

    Any one know what happened to it? I would be a nice feature to have ??

    To claify: I was using javascript (embedded in a PHP file) as an include. PHP can include any type of file in a webpage. These plugins SHOULD be able to support this or wordpress should allow you to turn off the automatic adding of <br /> after each line.

    UDATE: I just found that (for both runPHP and PHPexec) if you enclose your php in <pre> <pre> tags, WordPress won’t insert <br /> at the end of each line of the resulting html.

    However, some php includes still don’t work as expected. I’m not sure yet what is happening.

    If you are looking to call singular functions, or include one specific file, CG-QuickPHP is a faster method in many cases. It can make one function call with static-typed parameters (though it accepts strings, numbers, and true/false), so it can do an include(“file”) just as easily as any other function. Just FYI.

    -d

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Run PHP Functions in Pages and Posts?’ is closed to new replies.