WP allows JavaScript in the code view for a post or a page. So this makes today's idea fairly easy.
My
referenceSo need to input a person's weight and possibly convert to metric for calculations. I have a table already on my vegan site with every conversion I could find so that is not a problem. Weight could be pounds or even stones.
Now I need some inputs, one for the weight with a possible choice of units etc etc
Code:
function HB_BMR(weight, age, height) { // kg, years, centimeters
return 66.5 + ( 13.75 × weight ) + ( 5.003 × height ) – ( 6.755 × age );
}
the second one is active level which can be used to estimate the number of calories a person needs.
Code:
function BMR(base, active) {
switch active {
case 1:
return base * 1.2;
break;
case 2:
return base * 1.375;
break;
case 3:
return base * 1.55;
break;
case 4:
return base * 1.75;
break;
case 5:
return base * 1.9;
break;
default:
return base * 1.2;
break;
}
}
I guess I need to use a HTML form for the inputs?
_________________
Hardcore Games Legendary is the Only Way to Play!
Vegan Advocate 16 lbs grain to make only 1 lb meat, water for 6 months of showers and 34.1 lbs carbon dioxide
My sites are made with WordPress, which is a content management system which now accounts for more than 60% of all websites