Skip to:
Content
Pages
Categories
Search
Top
Bottom

Menu item added with "wp_nav_menu_items" gives "damaged" url


  • admin25
    Participant

    @admin25

    Hello, I am adding menu items with the code below, the menu items show up when clicked the give damaged url’s

    e.g for the top link when clicked

    
    http://timothylhanson.com/bp/%3C?php%20return%20bp_loggedin_user_domain()%20?%3Eactivity/just-me/
    

    clearly this

    
    
    

    is not being returned properly

    Any help with this is greatly aprriciated
    Thanks

    
    function add_profile_link_to_nav($items) {
        if ( is_user_logged_in() )
    
    return $items . 
     '<li><a href="activity/just-me/">My Wall</a>
    
       <ul>
         
         <li><a href="activity/friends/">My Friends Activities</a></li>
         <li> <a href="profile/edit/group/1">Edit My Profile</a></li>
     
        </ul>
      </li>';
    }
    add_filter('wp_nav_menu_items','add_profile_link_to_nav', 10, 2); 
    
Viewing 3 replies - 1 through 3 (of 3 total)

  • admin25
    Participant

    @admin25

    The code did not show up! trying again.

    function add_profile_link_to_nav($items) {
        if ( is_user_logged_in() )
    
    return $items . 
     '<li><a href="activity/just-me/">My Wall</a>
    
    <ul>
    
     <li><a href="activity/friends/">My Friends Activities</a></li>
     <li> <a href="profile/edit/group/1">Edit My Profile</a></li>
    
    </ul>
     </li>';
    }
    add_filter('wp_nav_menu_items','add_profile_link_to_nav', 10, 2);

    admin25
    Participant

    @admin25

    Ok how do you add code? I though putting the code between the CODE tags would work


    @mercime
    Participant

    @mercime

    Try adding code tags in Visual mode. Or better yet, paste code in pastebin.com and post the generated URL here. e.g.

    <?php if  ( is_user_logged_in() )  ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Menu item added with "wp_nav_menu_items" gives "damaged" url’ is closed to new replies.
Skip to toolbar