Jump to content

How to add custom php app in wordpress


Recommended Posts

Hey there

I was hoping for some advice please. I have a wordpress website but I want to add a custom php app (library files includes php/js/css and some php code to be pasted in the page) to a specific page. I've read it's not good practice to put the files in root directory and can understand why. The app is only suppose run on a specific page and having it running outside of wp is not where I want to go.  So I'd really like to be able to put the files somewhere else in the wp directory and call the script using the themes functions.php or perhaps  add a custom plugin to achieve this. I'm a bit of a noob and not sure how to do either of these, so any tips would be greatly appreciated.

Thank you


Link to comment
Share on other sites

What are you trying to do?  I'm a PHP tinkerer at best, with a lot of help, but I've been using PHP in WordPress for about a decade.  

If you're talking about creating a plugin, that's a process that's pretty easy to start, but really tying it into your site, you'll need to study up on WordPress' codex and template tags: 



If you're talking about putting information onto certain pages, now you're talking about inserting PHP into a page, which isn't native in WordPress.  I'd get a plugin called PHP Code Snippet by XYZscripts.  It's fantastic, and it allows you to easily use code snippets through your site.  From there, I use INCLUDES to associate PHP files to my WP Pages, and I update the PHP files in any text editor.  

I would recommend checking out the Template Tags no matter what.  You can use them in your PHP files just for simple calls, as a lot of what I do involves referring to items within WP.  



  • Great Answer 1
Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.