help showing different content depending on page, user & friend profiles
-
ok…ive seen this before, but there was one thing missing. what im trying to do, is display a specific menu on certain pages in the right panel. i got the menu up, and it works on the home page, but my problem is with the user profile (in this case, the logged in person) and a memeber profile ( friend, and or nonfriend) i want the menu contents to change depending on which page your on. So, if im on my profile, i see my menu, if im on a friends page, a different menu, and lastly, if on a non-friends page different menu displyed lol. i know…
i was using an if statement like so:
<?php if ( is_home() ) { ?>
<h5 id=”panel-title”><?php _e( ‘home’, ‘buddypress’ ) ?></h5>
<ul class=”hook_menu”><img src=”<?php bloginfo(‘template_directory’); ?>/images/local/category-arrow.gif” />
Menu for home
<?php } elseif ( bp_is_user_profile() ) { ?>
<h5 id=”panel-title”><?php global $current_user;get_currentuserinfo(); echo ” . $current_user->user_login . “”; ?></h5>
<ul class=”hook_menu”><img src=”<?php bloginfo(‘template_directory’); ?>/images/local/category-arrow.gif” />
Menu for another member or my friends profile
<?php } elseif ( bp_is_my_profile() ) { ?>
<h5 id=”panel-title”><?php global $current_user;get_currentuserinfo(); echo ” . $current_user->user_login . “”; ?></h5>
<ul class=”hook_menu”><img src=”<?php bloginfo(‘template_directory’); ?>/images/local/category-arrow.gif” />
Menu for my profile
<?php } ?>
im not sure what tags to use for my profile and other profiles…anyone know? thanks a bunch ahead of time!
oh also, whats the tag for displaying that members name, not the loggedin user, but your friend?
-
Have a look at https://codex.buddypress.org/developer-docs/conditional-template-tags/ for details on the template tags. It’s a little out of date but should suffice.
thanks paul, i checked there, but im having a hard time setting the difference between the logged in user (which is the easy one lol) and the logged in user friends page. If im not mistaken, there is two ways a profile is viewed right? the way the logged in user sees it, and the way everyone else sees it. but i think i got the most part of it, thanks again!
- The topic ‘help showing different content depending on page, user & friend profiles’ is closed to new replies.