Hey,
You should create a custom plugin for it, or you should add it using a child theme, instead of adding it to theme folders.
After that, you can add the JS and CSS files to your site using https://developer.wordpress.org/reference/functions/wp_enqueue_script/ and https://developer.wordpress.org/reference/functions/wp_enqueue_style/
Then you can post the HTML to your page, or create a page template https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/
Hope this will help. 🙂
I will give it a shot and report back. Thanks a lot.
Hardeep,
So sorry for the delay. I liked the idea of a WP plugin so I tried to go down that road as time permitted but having some issues… I was hoping you might see the flaw…
I had two variants of my calc. one was the html, css and js files. The other, which I tried to use has the following:
A main calculator.php file. In that same directory is a subfolder that has the main css and js files.
I created an includes folder and place the structure above in it. In the same level as the includes folder I made a Horse racing calculator.php file to act as the main file..
I tried this…
<?php
/*
Plugin Name: HorseRacingCalculator
Description: A horse wagering calculator to take all the guesswork out of making a bet-amount
Version: 1.0
Author: Adam Solowiei
*/
define( ‘Horse_Calc_Files_Path’, plugin_dir_path( __FILE__ ) );
include( Horse_Calc_Files_Path . ‘Includes/calculator.php’ );
?>
//My plugin shortcode
<?
function HorseCalculator(){
return ‘calculator.php’;
}
add_shortcode(‘HorseCalc’, ‘HorseCalculator’);
?>
But…no joy and the raw calc just takes over the dashboard page. I know I am doing something wrong but missing it. My calculator.pp file is the brain of the item so I want the shortcode to call it and have things run from there.. Is there something obvious I am missing???
Hi,
As per forum guidelines, please create a new thread for a new question. And you should include the calculator.php file maybe. It can be done in a lot of ways tho.
Anyway, a new thread will be more appropriate for that discussion. Hope you understand. 🙂