Jump to content


Photo
- - - - -

How Can I add PHP Code to my main navigation menu?


  • Please log in to reply
3 replies to this topic

#1 gayatriom

gayatriom

    Advocate

  • Members

  • 559 posts
  • Country: Country Flag

Posted 06 April 2011 - 08:20 PM

Hey. So I am using buddypress and I have the php code to add a 'Your profile' link. But I am trying to add it to the main navigation menu. Is that possible?

#2 gayatriom

gayatriom

    Advocate

  • Members

  • 559 posts
  • Country: Country Flag

Posted 06 April 2011 - 09:09 PM

After doing some research i discovered that i must add Something like the below code to my bp-custom.php folder. However, since I am using a custom wordpress menu,the 'bp_nav_items' part of the below code would be irrelevant. Do you know what the main nav is called in pagelines? <?php add_action("bp_nav_items","show_user_link"); function show_user_link(){ if(!is_user_logged_in()) return; ?> <li<?php if ( bp_is_home()) : ?> class="selected"<?php endif; ?>> ">MY Profile <?php } ?>

#3 timlinson

timlinson

    Advocate

  • Members
  • PipPipPipPipPip
  • 1032 posts

Posted 07 April 2011 - 02:58 AM

If you're using PlatformPro, go to Template Setup and click the "Advanced Setup" link of the "Navigation" block. You'll see some primary nav related hook names that you could try.

#4 gayatriom

gayatriom

    Advocate

  • Members

  • 559 posts
  • Country: Country Flag

Posted 07 April 2011 - 01:24 PM

hmm ok. cool. thanks. Ya i'm using platform pro.