Title: PHP Code for only Showing the Points
Last modified: August 31, 2016

---

# PHP Code for only Showing the Points

 *  Resolved [isikerkan](https://wordpress.org/support/users/isikerkan/)
 * (@isikerkan)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/php-code-for-only-showing-the-points/)
 * Hi dear web-able Team
 * I bought your Plugin over CodeCanyon.
 * On the betting widget it doesn’t show the Points of the user. On my site I would
   like to implement the points on the Navigation Menu with a PHP Code. I tried 
   to copy and edit the code in the widget, but that doesnt work.
 * Is it possible that you maybe post me the PHP code for showing the points?
 * [https://wordpress.org/plugins/betpress/](https://wordpress.org/plugins/betpress/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [web-able](https://wordpress.org/support/users/web-able/)
 * (@web-able)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/php-code-for-only-showing-the-points/#post-7420431)
 * Here you go:
 *     ```
       <?php
       $user_ID = get_current_user_id();
       $user_points = 'Please login or register';
       if ($user_ID) {
           $user_db_points = get_user_meta($user_ID, 'bp_points', true);
           $user_points = ('' === $user_db_points) ? get_option('bp_starting_points') : $user_db_points;
       }
   
       echo $user_points;
       ?>
       ```
   
 * Now the $user_points variable will have the user’s points, the last line (the
   one which starts with echo) is how you print it on the website.
    You can change
   the text “Please login or register” to anything you want to be shown to the not
   logged in users. If you want the points to be automatically updated right after
   the user submit a slip, just apply the “points-holder” class to the html element
   like this: `<span class="points-holder"><?php echo $user_points; ?></span>` It
   is not necessary this to be a “span” element, it can be anything. But the problem
   with this is that the text “Your points: ” will be added just before the points
   and you will have no control over this.

Viewing 1 replies (of 1 total)

The topic ‘PHP Code for only Showing the Points’ is closed to new replies.

 * ![](https://ps.w.org/betpress/assets/icon-256x256.png?rev=1335078)
 * [BetPress](https://wordpress.org/plugins/betpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/betpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/betpress/)
 * [Active Topics](https://wordpress.org/support/plugin/betpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/betpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/betpress/reviews/)

## Tags

 * [php code](https://wordpress.org/support/topic-tag/php-code/)

 * 1 reply
 * 2 participants
 * Last reply from: [web-able](https://wordpress.org/support/users/web-able/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/php-code-for-only-showing-the-points/#post-7420431)
 * Status: resolved