I have a wordpress page where I want to include a budget calculation tool.

This budget calculation tool is of course tied to a php script that executes the fields in the budget calculation tool. This php script lives in the file "view.php"

My question is: how can I execute this php script in Wordpress

Here is the script working in a simple HTML/CSS/Js form:

I am so sure this is a beginner thing, but I just can't get my head around it! What am I missing here?

Thanks so much!



2 Answers 2


The short answer is to add it to whatever page template you would like. The view.php file sounds like the wrong place, but if you want it there, just add that code to whatever section of the page you want.

If you want to go a better route, I'd turn that bad boy into a shortcode. Shortcodes have a bit of a learning curve, but are extremely useful. The benefit to this being that instead of having to copy/paste the code into a new area each time - you can just call [calculator] or whatever you eventually name the shortcode. If you want to execute the shortcode in a template file simply put something like this: <?php echo do_shortcode('[calculator]'); ?>


I would go about this by creating a custom page template. Then plug in the HTML and apply the scripts to this template by embedding the scripts or using wp-enqueue. Then you need to create a new page in WP and assign it the page template you just created with the calculation tool.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.