Custom Function doesn’t works on Avada Layout
-
Hi Jose,
first of all I would like to compliment you on the app. It seems very useful and well made. I think I will purchase the pro version very soon.I’ve a code snippet format custom post rating number.
It works fine on a page where post are in grids.
You can see in: Economia – WeYourConsultBut when I open the post the number is show as:
Rating: [format-currency num=”1.020” sym=””]La Contabilità in breve – WeYourConsult
If I disable FreeSoul it works fine, and also if I activate all plugins for pages or CPT, results doesn’t change.
In order to call the function I use Avada subtitle layout: https://avada.com/documentation/category/layouts/
With Avada builder I insert a Text block like:
{!{wpv-conditional if="( $(wpcf-overall-cust-ea-postrat) gt '0' )"}!} Rating: [format-currency num="{!{types field='overall-cust-ea-postrat' format='FIELD_VALUE'}!}{!{/types}!}" sym=""] {!{/wpv-conditional}!}
Here below the function I use:
function format_my_number($atts) { $atts = shortcode_atts( array( 'num' => '', 'sym' => '', ), $atts ); if ($atts['num'] == 0 || $atts['num'] == '0' || $atts['num'] == 'NULL' || $atts['num'] == NULL) { $atts = shortcode_atts( array( 'num' => 1, 'sym' => '@', ), $atts ); return $atts['sym'] .$atts['num']; } else { $num = $atts['num']; return $atts['sym'].' '.number_format($num - 0.05, 1, ',', '.') ; } } add_shortcode('format-currency', 'format_my_number');
I tried to see forum, documents and resources for developers, disabled lazy loading, but I havent’t found an answer. Do you have any suggesiton about what to check?
Many thanks, Marco.
The page I need help with: [log in to see the link]
- The topic ‘Custom Function doesn’t works on Avada Layout’ is closed to new replies.