Add UserBar to Your template file

From PeepSo Docs
Jump to: navigation, search

To add PeepSo UserBar widget anywhere in your template files, we will use Wordpress function called the_widget as you can see on the example below:

<?php the_widget( 'PeepSoWidgetUserBar', "show_avatar=1&show_notifications=1&content_position=right" ); ?>

This specific code above will render the widget with Avatar and Notifications, aligned to the right side.

Available options for this widget are:

  • guest_behavior= (hide / login) - Show/hide widget login link for guests
  • content_position= (left / right / center / space) - Align widget content
  • show_avatar=1 - Show user avatar
  • show_name=1 - Show user name
  • show_usermenu=1 - Show User Dropdown menu
  • show_notifications=1 - Show notifications
  • show_logout=1 - Show logout icon next to the notifications
  • show_vip=1 - Show VIP icons
  • show_badges=1 - Show Badges from BadgeOS integration

Every option has to be separated with “&”.

Here is the example with more options enabled:

<?php the_widget( 'PeepSoWidgetUserBar', "guest_behavior=hide&show_avatar=1&show_notifications=1&show_name=1&content_position=left&logout=1" ); ?>