• Resolved lovinourtextures

    (@lovinourtextures)


    I really like the stat counter feature in the benevolent theme. However, I wanted to add 0 as one of the stats, but the theme isn’t letting me. Any help is greatly appreciated. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi!

    I don’t know if I would recommend getting into the php code unless you understand it but in the customizer.php file there is this code:

    /** First Stat Counter Number */
    $wp_customize->add_setting(
    ‘benevolent_first_stats_number’,
    array(
    ‘default’ => ”,
    ‘sanitize_callback’ => ‘benevolent_sanitize_number_absint’,
    )
    );

    The ‘sanitize_callback’ is the one not letting 0’s be inputted. Deleting that line below fixed it.

    /** First Stat Counter Number */
    $wp_customize->add_setting(
    ‘benevolent_first_stats_number’,
    array(
    ‘default’ => ”,
    )
    );

    Unfortunately, you will want a child them and hook in the function and call in the function from there. If you change it in the theme you are using an update will come and get rid of it.

    As far as my knowledge the only way you can get what you want is by changing some php code.

    Thread Starter lovinourtextures

    (@lovinourtextures)

    Hello. While I’m grateful for your response, unfortunately it did not work for me. When I input “0” it disappears. ?? It only appears with the number 1 or greater.

    Try inputting 00

    Thread Starter lovinourtextures

    (@lovinourtextures)

    Thanks so much! It worked. You’re a life saver. ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Stat Counter’ is closed to new replies.