Advertisement
cyberdev

Untitled

Jul 18th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.49 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The template part for displaying user navigation
  4.  *
  5.  * @package Bimber_Theme 4.10
  6.  */
  7.  
  8. ?>
  9.         <?php if (!is_user_logged_in()): ?>
  10.             <a class="g1-button g1-button-m g1-button-solid snax-button snax-button-create"  href="?snax_login_popup">Sign Up</a>
  11.         <?php endif; ?>
  12. <?php if ( bimber_can_use_plugin( 'snax/snax.php' ) ) : ?>
  13.     <?php if ( snax_show_create_button() ): ?>
  14.         <?php
  15.         $snax_class = array(
  16.             'g1-button',
  17.             'g1-button-m',
  18.             'g1-button-solid',
  19.             'snax-button',
  20.             'snax-button-create',
  21.         );
  22.         ?>
  23.         <a class="<?php echo implode( ' ', array_map( 'sanitize_html_class', $snax_class ) ); ?>"
  24.            href="<?php echo esc_url( snax_get_frontend_submission_page_url() ); ?>"><?php echo esc_html( bimber_get_theme_option( 'snax', 'header_create_button_label' ) ); ?></a>
  25.     <?php endif; ?>
  26. <?php endif; ?>
  27.  
  28.  
  29. <!-- BEGIN .g1-user-nav -->
  30. <?php if ( has_nav_menu( 'bimber_user_nav' ) ) : ?>
  31.     <nav class="g1-drop g1-drop-before g1-drop-the-user">
  32.  
  33.         <?php
  34.         $bimber_current_user = wp_get_current_user();
  35.         ?>
  36.  
  37.         <?php if ( is_user_logged_in() ) : ?>
  38.             <a class="g1-drop-toggle" href="<?php echo esc_url( get_author_posts_url( get_current_user_id() ) ); ?>">
  39.                 <i class="g1-drop-toggle-icon">
  40.                     <?php
  41.                     if ( 'bunchy' === bimber_get_theme_option( 'global', 'stack' ) ) {
  42.                         echo get_avatar( $bimber_current_user->user_email, 40 );
  43.                     } else {
  44.                         echo get_avatar( $bimber_current_user->user_email, 30 );
  45.                     } ?>
  46.                 </i>
  47.                 <?php echo esc_html( $bimber_current_user->display_name ); ?>
  48.  
  49.                 <?php if ( bimber_can_use_plugin( 'buddypress/bp-loader.php' ) && bp_is_active( 'notifications' ) ) : ?>
  50.                     <?php
  51.                     $bimber_count = intval( bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ) );
  52.                     ?>
  53.                     <?php if ( $bimber_count ) : ?>
  54.                         <span class="g1-drop-toggle-badge"><?php echo intval( $bimber_count ); ?></span>
  55.                     <?php endif; ?>
  56.                 <?php endif; ?>
  57.  
  58.                 <span class="g1-drop-toggle-arrow"></span>
  59.             </a>
  60.         <?php else : ?>
  61.             <a class="g1-drop-toggle snax-login-required" href="#">
  62.                 <i class="g1-drop-toggle-icon"></i>
  63.                 <span class="g1-drop-toggle-arrow"></span>
  64.             </a>
  65.         <?php endif; ?>
  66.  
  67.         <?php wp_nav_menu( array(
  68.             'theme_location'    => 'bimber_user_nav',
  69.             'container'         => 'div',
  70.             'container_class'   => 'g1-drop-content',
  71.             'menu_class'        => 'sub-menu',
  72.             'menu_id'           => '',
  73.             'depth'             => 0,
  74.         ) );
  75.         ?>
  76.     </nav>
  77. <?php endif; ?>
  78. <!-- END .g1-user-nav -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement