Title: Adding .php calculators
Last modified: August 21, 2016

---

# Adding .php calculators

 *  [smarinokw](https://wordpress.org/support/users/smarinokw/)
 * (@smarinokw)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/adding-php-calculators/)
 * Hey guys and gals. So I have downloaded some php based calculators for use on
   my website (real estate). The installation instructions are for a conventional
   website, not wordpress (I think), and though I have tried to contact the producer
   of these files, I have not received a response yet. So I figured I would reach
   out to the community.
 * I have a folder of various real estate calculators that are all .php files, and
   I would like to add them to my site. How would I go about doing this?
 * I am trying to add them so that I can make a page or two, and have the calculators
   appear on the page. I’m guessing that I could probably just place them in a custom
   page template, but I’m not sure how I’d need to call them in, or where I need
   to put the files in my wordpress directory.
 * Any help would be appreciated. If you need more clarification, please ask!

Viewing 13 replies - 1 through 13 (of 13 total)

 *  [Josh](https://wordpress.org/support/users/josh401/)
 * (@josh401)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/adding-php-calculators/#post-3875365)
 * Hmmmm…
 * It’s honestly going to depend on how you would like the “user” of the website
   to interact with the calculator.
 * Do you want it on it’s own page that will have to be opened in the browser? Do
   you want it inside certain pages… displayed at “will”?
 *  Thread Starter [smarinokw](https://wordpress.org/support/users/smarinokw/)
 * (@smarinokw)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/adding-php-calculators/#post-3875368)
 * Good question! I would like to have one calculator per page, but I will include
   links to the other calculators on the page, or use a menu to link to the others.
 *  [Rob Broley](https://wordpress.org/support/users/rob-broley/)
 * (@rob-broley)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/adding-php-calculators/#post-3875370)
 * I think it depends what you want the calculator to do really. As you can make
   it really easy to use or really hard. Have you tried looking for a plugin?
 *  [Josh](https://wordpress.org/support/users/josh401/)
 * (@josh401)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/adding-php-calculators/#post-3875373)
 * Haha – sooo both?? 😉
 * Well… I think the template idea would be best for the individual “page” calculators.
   This will let you adjust each php template uniquely.. so you can have multiple
   templates, each with a different calculator.
 * As far as adding them inside a page… is a little more tricky. I think the best
   approach would be defining them in a [Child Theme](http://codex.wordpress.org/Child_Themes)
   functions.php file. Then, we could call them dynamically from each post/page 
   via a shortcode or other callback.
 * Ummmm…. have you created a child theme?
 *  Thread Starter [smarinokw](https://wordpress.org/support/users/smarinokw/)
 * (@smarinokw)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/adding-php-calculators/#post-3875383)
 * Haha, yes both i guess. I’m really just trying to make the site easy for people
   to use.
 *  Rob, can you clarify a bit? I have a file folder of ready to go calculators,
   I just need to get them onto my site, and working/ useable. Or were you referring
   to finding a plugin to make them work?
 * Josh, would it be possible to insert each calculator into a page, and just have
   each one be a unique template? Here’s a link to how they should look/ work.
    
   [http://www.mortgage-site-tools.com/common-mortgage-calculators/mortgage-principal-calculator.php](http://www.mortgage-site-tools.com/common-mortgage-calculators/mortgage-principal-calculator.php)
 *  Thread Starter [smarinokw](https://wordpress.org/support/users/smarinokw/)
 * (@smarinokw)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/adding-php-calculators/#post-3875385)
 * Oh, sorry, i missed the bit about the child theme. i’m running Cherry Framework
   with a child theme already. Not sure if that matters.
 *  [Josh](https://wordpress.org/support/users/josh401/)
 * (@josh401)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/adding-php-calculators/#post-3875408)
 * > i’m running Cherry Framework with a child theme already.
 * I think so. I’m not familiar with Cherry Framework. But, if it allows you to 
   add custom functions without fear of being over-written when the theme is updated..
   then you are good to go!
 * No.. you can’t call one php file from another within WP. Well, not very easily..
   anyways.
 * Instead, I would write it as a function in my child theme `functions.php` file,
   and apply it to the WP editor via a shortcode.
 * Optionally, you MIGHT be able to use a plugin like this:
    [http://wordpress.org/plugins/allow-php-in-posts-and-pages/](http://wordpress.org/plugins/allow-php-in-posts-and-pages/)
 * It allows the use of PHP inside a post/page. I haven’t tested the plugin, so 
   I can’t say for sure. Besides, I always like coding my own stuff 😉 But, it “
   might” provide an easier method.
 * Thoughts??
 *  Thread Starter [smarinokw](https://wordpress.org/support/users/smarinokw/)
 * (@smarinokw)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/adding-php-calculators/#post-3875417)
 * That might work, I’ll give it a try. Keep in mind that I’m not a programmer, 
   and only taught myself how to mess with code to save money haha.
 * I think the theme won’t overwrite custom functions but i’m not sure.
 * I’ll let you know how/ if either of these solutions work, and I really appreciate
   the help so far!
    Is there any specific location where I should upload the files?
   Should I put theme in my theme, wp-includes, wp-content, etc?
 *  [Josh](https://wordpress.org/support/users/josh401/)
 * (@josh401)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/adding-php-calculators/#post-3875424)
 * If you want to make templates for actual pages of calculators.. then yes, you
   will need to add them to your theme as template files. Typically, they are placed
   in the root of the theme folder. But, you might want to check the support resources
   for your theme to see if they do it the same way.
 * As far as the php plugin… I don’t think you’ll need to add any files for that.
   Just copy and paste your php code into the plugin, I presume…
 *  Thread Starter [smarinokw](https://wordpress.org/support/users/smarinokw/)
 * (@smarinokw)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/adding-php-calculators/#post-3875436)
 * Ok, thanks. Let me look into all of this, and see if I can’t make it work.
 *  [Josh](https://wordpress.org/support/users/josh401/)
 * (@josh401)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/adding-php-calculators/#post-3875438)
 * No worries!
 * Lemme know how you fare!
 *  Thread Starter [smarinokw](https://wordpress.org/support/users/smarinokw/)
 * (@smarinokw)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/adding-php-calculators/#post-3875481)
 * Ok, so it appears that the insert php plugin would work, but I’m getting errors
   where it code for the calculators tries to call in other .php files, and a few
   other errors. I’m not sure if the plugins support multiple call-ins, or if that’s
   even possible. I haven’t tried making pages yet, but it looks like I may have
   to at least install all of these in my root directory.
 * It would be kind of nice if I could just create a few files and call them in 
   like the pieces of the page like get_template_part, or if I could just put all
   the code in one page and have it work haha. I really don’t want to have to pay
   a programmer to do this, but it looks like i might have to.
 *  [Josh](https://wordpress.org/support/users/josh401/)
 * (@josh401)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/adding-php-calculators/#post-3875600)
 * Yeah… without seeing the actual structure of the php code… it’s going to be hard
   providing specific guidance within the scope of these forums.
 * If you would like to [contact me](http://www.joshlobe.com/contact-me/)… I may
   be able to provide some additional help.

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘Adding .php calculators’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 13 replies
 * 3 participants
 * Last reply from: [Josh](https://wordpress.org/support/users/josh401/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/adding-php-calculators/#post-3875600)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
