Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if( ! function_exists( 'videotube_add_login_profile_menu_item' ) ){
- /**
- * @param html $items
- * @param array $args
- */
- function videotube_add_login_profile_menu_item( $items, $args ) {
- if( $args->theme_location != 'header_main_navigation' ){
- return $items;
- }
- // The custom login page url goes here
- $login_url = '';
- // The custom profile page url goes here
- // In your case, it's http://jukeboxculture.com/index.php/profile/
- $profile_url = '';
- if( ! is_user_logged_in() ){
- $items .= '<li class="login">
- <a href="'. esc_url( $login_url ) .'">'. esc_html__( 'Login', 'mars' ) .'</a>
- </li>';
- }
- else{
- $items .= '<li class="profile">
- <a href="'. esc_url( $profile_url ) .'">'. esc_html__( 'Profile', 'mars' ) .'</a>
- </li>';
- }
- return $items;
- }
- add_filter( 'wp_nav_menu_items','videotube_add_login_profile_menu_item', 10, 2 );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement