Support » Plugin: WP ULike » Remove " " sign in counter

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Alimir

    (@alimir)

    Hi @ovidiuav
    You can add this filter by copy & paste the following code in your theme’s function.php file: 🙂

    <?php
    add_filter('wp_ulike_format_number','wp_ulike_new_format_number',10,3);
    function wp_ulike_new_format_number($value, $num, $plus){
        if ($num >= 1000 && get_option('wp_ulike_format_number') == '1'):
        $value = round($num/1000, 2) . 'K';
        else:
        $value = $num;
        endif;
        return $value;
    }
    ?>

    thanks for answering!
    unfortunately, I use DMS which is different from regular themes and adding that to functions.php just breaks my blog.

    here’s what’s in my functions.php:

    <?php
    /**
     * FUNCTIONS / THEME INITIALIZATION
     *
     * This file loads the core framework which handles everything.
     *
     * @package     PageLines Framework
     * @since       1.0
     *
     * @link        http://www.pagelines.com/
     * @link        http://www.pagelines.com/DMS
     *
     * @author      PageLines   http://www.pagelines.com/
     * @copyright   Copyright (c) 2008-2013, PageLines  hello@pagelines.com
     *
     * @internal    last revised January 20, 2012
     * @version     ...
     *
     * @todo Define version
     */
    require_once( get_template_directory() . '/includes/init.php' );

    @ovidiu Avrămuş you can still add the code. You probably copied it too literally.

    <?php
    /**
     * FUNCTIONS / THEME INITIALIZATION
     *
     * This file loads the core framework which handles everything.
     *
     * @package     PageLines Framework
     * @since       1.0
     *
     * @link        http://www.pagelines.com/
     * @link        http://www.pagelines.com/DMS
     *
     * @author      PageLines   http://www.pagelines.com/
     * @copyright   Copyright (c) 2008-2013, PageLines  hello@pagelines.com
     *
     * @internal    last revised January 20, 2012
     * @version     ...
     *
     * @todo Define version
     */
    require_once( get_template_directory() . '/includes/init.php' );
    add_filter('wp_ulike_format_number','wp_ulike_new_format_number',10,3);
    function wp_ulike_new_format_number($value, $num, $plus){
        if ($num >= 1000 && get_option('wp_ulike_format_number') == '1'):
        $value = round($num/1000, 2) . 'K';
        else:
        $value = $num;
        endif;
        return $value;
    }

    Thanks Simon, it seems I hadn’t added it right. Cheers!

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.