• Resolved NAROLLES

    (@narolles)


    Hello Hector
    I hope you are well
    I have my function.php file which refuses to validate these elements
    they had been in place for several years but while trying to resolve a problem – I saw that the file refused to validate this part

    Maybe something has changed
    thank you for your help

    /**
    * 2023 WPP nombre de vues
    * Short code Wpp_View
    */

    function wpp_viewcounter($option)
    {
    if ( function_exists('wpp_get_views') )
    {
    $nbView = wpp_get_views( get_the_ID() );
    $iNbView = intval( preg_replace("/[^0-9]/", "", $nbView) );
    return colorCounterView($iNbView);
    }
    }
    add_shortcode( 'wpp_counter_view', 'wpp_viewcounter' );

    function colorCounterView($number)
    {
    $counterColorBegin = "";
    $counterColorEnd = "";
    $num = intval( preg_replace("/[^0-9]/", "", $number) );

    if ( $num > 100 )
    {
    $counterImportant = "";
    if ($num >100) {$counterImportant = '-normal';}
    if ($num >300) {$counterImportant = '-good';}
    if ($num >500) {$counterImportant = '-verygood';}
    if ($num >1000) {$counterImportant = '-important';}
    if ($num >2000) {$counterImportant = '-veryimportant';}

    $counterColorBegin ='<span class="eye-counter-color' . $counterImportant .'">';
    $counterColorEnd = '</span>';
    }
    else {
    if ( strlen($number) > 4 ) {
    $counterImportant = '-veryimportant';
    $counterColorBegin ='<span class="eye-counter-color' . $counterImportant .'">';
    $counterColorEnd ='</span>';
    }
    }

    $views = sprintf(
    _n('%s vue', '%s vues', $number, 'wordpress-popular-posts'),
    $number
    );

    return $counterColorBegin . $views . $counterColorEnd;
    }

    The page I need help with: [log in to see the link]

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