How can I integrate pages written in something other than PHP?

In a WordPress blogsite, I’d like to add additional functionality but write it something other than PHP if possible, Python for example. For example, I’d like to create a self-scheduling page for a business so that clients can choose appointment times, and then write an admin side for the business to view and manage the bookings. Of course all I really care about from WP for this sub-area is the header/footer and menu links presented on the customer-facing pages.

I can imagine a scheme such as creating Pages that contain nothing more than a div and a bit of Javascript to fill the div with content from a Python-backed page, but don’t have a good feel for whether this is a good idea.

I guess my question is whether there’s a good way to use WordPress for the general page layout but use something other than PHP for the content area?

3 Answers
3

You’ve got a couple of options here, but they’re all pretty hacky …

iFrame

The easiest way would be to script your external application in whatever language you want and embed it in a typical WordPress page using an iFrame.

Applet

Java, Flash, Air, and Silverlight are all objects embedded directly into HTML pages. If your external application were using one of these technologies, you could easily embed the object on a standard WordPress page.

A better way …

I’m not going to ask why you don’t want to use PHP, because that’s not really the point here. But what you could do is script an external application and expose an API. Then you can have WordPress interface directly with the API and use PHP to display all of the content.

I recommend this because you’re no longer merely embedding an application inside a page, but actually tying the application together with WordPress. I’ve actually seen people tie WP together with Python scripts running on the server, so it is possible.

It’s more a question of what exactly you’re trying to accomplish, what technologies you plan to use, and you relative skill with each.

Leave a Comment