Viewing 3 posts - 1 through 3 (of 3 total)
-
AuthorPosts
-
October 26, 2015 at 3:11 pm #524927
Hi,
I am trying to get Animated numbers to work so they echo the result of a SQL query.
This is working fine if I create a custom template and there use something like this:<div class="flex_column av_one_third first avia-builder-el-0 el_before_av_one_third avia-builder-el-first "> <div class="avia-animated-number av-force-default-color avia-color- avia-builder-el-7 avia-builder-el-no-sibling avia_animate_when_visible number_prepared avia_start_animation"> <strong class="heading avia-animated-number-title"> <span class="avia-animated-number-icon av-icon-before-number av-icon-char" aria-hidden="true" data-av_icon="" data-av_iconfont="entypo-fontello"></span> <span class="avia-single-number" data-number="<?php $cork_count = $wpdb->get_var( "SELECT COUNT(site) FROM rotw_survey WHERE site='Cork'" ); echo "{$cork_count}";?>"><?php $cork_count = $wpdb->get_var( "SELECT COUNT(site) FROM rotw_survey WHERE site='Cork'" ); echo "{$cork_count}";?></span> </strong> <div class="avia-animated-number-content"> <p>Portal Users</p> </div> </div> </div>I was hoping that I could use the same thing within the site builder using a codeblock but I cant get it to work. Would I need to change something or wrap the above somehow so it’s working within a codeblock?
Thanks,
MarcelOctober 26, 2015 at 3:56 pm #524966Hey mtupuschies!
You cannot execute PHP like that. You could try using a plugin such as this, https://wordpress.org/plugins/exec-php/.
Cheers!
ElliottOctober 26, 2015 at 5:36 pm #525083Hi Elliott,
Thanks for the fast response. Found a plugin which works great! Thanks for the tip!
-
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
- The topic ‘Animated Numbers with SQL Queries’ is closed to new replies.
