How to run JS, PHP and etc. inside WP post?

I would like to try little web apps with WordPress.

Just to accept some values for few fields and present the output using AJAX.

Read More

What are all the necessary modifications on WordPress?

So, far I’ve tried some plugins like exec-php. But, I am in need of a better advice/suggestion.

Related posts

Leave a Reply

1 comment

  1. Natively WordPress posts are subset of HTML (even more like semi-HTML – paragraph tags can be implied and added on output, but not stored). As result it really really doesn’t like to store or process active code in post’s content. This applies both to internal logic in PHP and front-end logic of post editor (it actively tries to strip some things like iframes, when switching to visual editor, etc).

    Basically you have two options:

    1. Loosen restrictions on what can be input and sotred in post content – like Exec-PHP you mention in question.
    2. Store active code elsewhere (in custom fields for example) and use shortcode in post content to call it.