views:

30

answers:

2

Hi there.

I have an existing webapp created in PHP and would like to embed some of the PHP code into some WordPress pages.

What's the best WordPress plugin for that?

A: 

Pasting PHP code into a plugin isn't a good idea. There are three approaches to embedding PHP scripts into a WordPress site:

  • Placing the code directly into a theme's main index template (messy)

  • Placing the code into a theme's functions.php file and hooking it into the site using the Plugin API. (cleaner)

  • Fully encapsulating the code in a plugin. (cleanest)

cowbellemoo
A: 

A lot of folks use EXEC-PHP. The Exec-PHP plugin executes code in your posts, pages and text widgets. One drawback may be that you will have to disable the WYSIWYG Editor but most people do that anyway.

Brad