Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Conditional Tag Questions (specifically bp_is_user_profile)


madyogi
Participant

@madyogi

Okay, so I followed your advice, toddlevy, but for whatever reason, I’m still getting my profile header the home page. The following is in my header.php file:

<?php

global $bp;

if ($bp->current_component == BP_XPROFILE_SLUG) {
include (TEMPLATEPATH . '/../ARHealthCareersFrameTheme/customHeaders/communityHeaderTest.php'); //include this header on BuddyPress profile pages
} elseif ( is_home() ) {
include (TEMPLATEPATH . '/../ARHealthCareersFrameTheme/customHeaders/homeHeader.php'); //include this header on home page
} elseif ( is_single() ) {
include (TEMPLATEPATH . '/../ARHealthCareersFrameTheme/customHeaders/homeHeader.php'); //include this header on posts
} elseif ( is_page('Why We're Here') ) {
include (TEMPLATEPATH . '/../ARHealthCareersFrameTheme/customHeaders/homeHeader.php'); //include this header on about page
} else {
include (TEMPLATEPATH . '/../ARHealthCareersFrameTheme/customHeaders/communityHeader.php'); //include this header on BuddyPress pages
} ?>

Any ideas as to why this would include communityHeaderTest.php on the home and about pages? Single pages are including the correct header.

I have been working with this code in my header, which seems to work for what I need:

<?php

if ( is_home() ) {
include (TEMPLATEPATH . '/../ARHealthCareersFrameTheme/customHeaders/homeHeader.php'); //include this header on home page
} elseif ( is_single() ) {
include (TEMPLATEPATH . '/../ARHealthCareersFrameTheme/customHeaders/homeHeader.php'); //include this header on posts
} elseif ( is_page('Why We're Here') ) {
include (TEMPLATEPATH . '/../ARHealthCareersFrameTheme/customHeaders/homeHeader.php'); //include this header on about page
} else {
include (TEMPLATEPATH . '/../ARHealthCareersFrameTheme/customHeaders/communityHeader.php'); //include this header on BuddyPress pages
} ?>

Still, it seems like I should just be able to use the BP conditionals to find out which specific BP page I’m on and display content accordingly.

Skip to toolbar