Forum Replies Created

Viewing 9 posts - 1 through 9 (of 9 total)
  • in reply to: Two characters in icon box? #161967
    Dr.Peril
    Member
    Post count: 10

    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!

    in reply to: Two characters in icon box? #158827
    Dr.Peril
    Member
    Post count: 10

    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?

    in reply to: Shortcode with variables? #157240
    Dr.Peril
    Member
    Post count: 10

    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!

    in reply to: Shortcode with variables? #157235
    Dr.Peril
    Member
    Post count: 10

    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?

    in reply to: Shortcode with variables? #157231
    Dr.Peril
    Member
    Post count: 10

    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!

    in reply to: Shortcode with variables? #154509
    Dr.Peril
    Member
    Post count: 10

    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!

    in reply to: Shortcode with variables? #154451
    Dr.Peril
    Member
    Post count: 10
    This reply has been marked as private.
    in reply to: Two characters in icon box? #154044
    Dr.Peril
    Member
    Post count: 10

    Fantastic thank you!

    in reply to: Sidebar on Individual Portfolio Pages #44849
    Dr.Peril
    Member
    Post count: 10

    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.

Viewing 9 posts - 1 through 9 (of 9 total)