Digital experiences for all disciplines
Forum Replies Created
-
Posted in: We hit Power Elite.
-
Hi Rui,
Sorry for my lateness, I’ve been away.
The link is here: http://www.waiting4wrath.com and http://www.waiting4wrath.com/beers/
I changed the shortcakes.php setting back to:
if (strlen($character) > 2) { $character = substr($character, 0, 2); }
But it doesn’t seem to work anymore…
Thoughts?
Thanks!Hey all,
I hate to bump and old issue, but this doesn’t seem to work anymore.
Following the most recent update, I reapplied the fix and while the numbers appear to include a point value initially, once one scrolls down enough to see the numbers and the counting up animation starts, it lands on the next highest .0 value. So 6.4 displays as 7, and 7.5 displays as 8.Thoughts?
Looks like I just needed to take a step back.
From Advanced Custom Fields Documentation:
the_field()
Displays the value of the specified field. (this is the same as “echo get_field($field_name)”)get_field()
Returns the value of the specified field.This is a very versatile function. You can use it to store a value, echo a value and interact with a value. Please note the type of variable returned is relative to the field type. Eg: A repeater will return a multidimensional array.
So the code:
<?php //$ba_score = 42; $ba_score = get_field('beer_advocate_score'); echo "Test".$ba_score; //$ba_score += '/ 100'; echo do_shortcode('[chart percentage="'.$ba_score.'" size="170" barcolour="" trackcolour="" content="'.$ba_score.' / 100" align="center"]'); ?>
Works.
Thanks!
This code enables both the circle label animation and the text in the circle to work:
<?php $ba_score = 42; // $ba_score = the_field('beer_advocate_score'); echo "Test".$ba_score; //$ba_score += '/ 100'; echo do_shortcode('[chart percentage="'.$ba_score.'" size="170" barcolour="" trackcolour="" content="'.$ba_score.' / 100" align="center"]'); ?>
I’m investigating the the_field(”) function from Advanced Custom Fields.
Thoughts?
Hey Mohammad,
I’ve double checked the code, and the value is being output above the circle. You can see little numbers. These are the printed output of the first time the variable is called (in the shortcode) the second time it’s called (what would be the printed text inside the circle) is coming back blank, so 0.
It’s like the code is printing the variable value outside of the theme’s shortcode then failing…
thanks!
I’ve implemented the code you provided and it seems to be a solid step in the right direction, however I’m still getting raw data output and no animation. I’ve left the code in the page so you can see the output.
Thanks!
This reply has been marked as private.Fantastic thank you!
Hey all, I would just like to add a +1 to this, and am going to code it in on my end. If I find a sufficiently friendly solution I’ll share it.
-
Posted in: We hit Power Elite.