This support ticket is created 8 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I am trying to:
In template:
<td>[wpv-calculate][types field="odds"]*[types field="units"][/wpv-calculate]</td>
Added to functions:
add_shortcode('wpv-calculate', 'calculate_shortcode');
function calculate_shortcode($atts,$content=null) {
$content = wpv_do_shortcode($content);
$content = eval("return $content;"); (this is line 364)
return $content = number_format($content,2);
}
I visited this URL:
I expected to see: The calculation works, but I get a Parse error. If I change to field+field the unexpected is [
Instead, I got: Parse error: syntax error, unexpected '*' in /var/sites/o/oddsspill.com/public_html/wp-content/themes/grafika/functions.php(364) : eval()'d code on line 1
I found the problem, in one of the post I did not fill inn the custom fields, so that made the calclutaion display only a *
When I filled out these it worked, I have to make conditonil display then, so if the custom fields is not filled in it will not display, that I can manage 🙂
Thanks!
This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.