Title: Create a function with the points variable
Last modified: August 21, 2016

---

# Create a function with the points variable

 *  Resolved [rogerhnn](https://wordpress.org/support/users/rogerhnn/)
 * (@rogerhnn)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/create-a-function-with-the-points-variable/)
 * Hi, I wanna create sometthing like this:
 * if($points > 0 && $points < 100)
    return <span class=”level”>Level 1</span> else
   if($points > 100 && $points <250) return <span class=”level”>Level 2</span>
 * I dont know if this is correct because I am not good with php.
    But I think you
   can understand, I want to display a text based on the points value. Like the 
   example above, if the user has more than 0 points and less than 100 points it
   displays the user level.
 * Can you help me with this?
    (I am using it with buddypress) Thank you
 * [http://wordpress.org/extend/plugins/badgeos/](http://wordpress.org/extend/plugins/badgeos/)

Viewing 16 replies (of 16 total)

[←](https://wordpress.org/support/topic/create-a-function-with-the-points-variable/?output_format=md)
[1](https://wordpress.org/support/topic/create-a-function-with-the-points-variable/?output_format=md)
2

 *  [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [12 years, 10 months ago](https://wordpress.org/support/topic/create-a-function-with-the-points-variable/page/2/#post-3894707)
 * Could you clarify what the error is? Having WP_DEBUG on will help with that and
   can pinpoint where the error is.
 * Just in case:
    [http://codex.wordpress.org/Editing_wp-config.php#Debug](http://codex.wordpress.org/Editing_wp-config.php#Debug)

Viewing 16 replies (of 16 total)

[←](https://wordpress.org/support/topic/create-a-function-with-the-points-variable/?output_format=md)
[1](https://wordpress.org/support/topic/create-a-function-with-the-points-variable/?output_format=md)
2

The topic ‘Create a function with the points variable’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/badgeos_85d3bc.svg)
 * [BadgeOS](https://wordpress.org/plugins/badgeos/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/badgeos/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/badgeos/)
 * [Active Topics](https://wordpress.org/support/plugin/badgeos/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/badgeos/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/badgeos/reviews/)

 * 16 replies
 * 2 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/create-a-function-with-the-points-variable/page/2/#post-3894707)
 * Status: resolved