It kills me when something SO basic doesn’t work!
So, nobody willing to spend a couple of minutes on this, at least to tell me if the code SHOULD do its job?
Logically it should. But it doesn’t.
Hi gian-ava . Try this assuming your active link is .active
<li<?php if ( bp_is_front_page() ) : ?> class="active"<?php endif; ?>>
<a href="<?php echo site_url() ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php _e( 'Home', 'buddypress' ) ?></a>
</li>
Thanks for the reply, mercime!
Nope, that doesn’t do it. The class “active” is not printed.
This is really weird, isn’t it?
Did you try is_home() instead?
https://codex.wordpress.org/Conditional_Tags
The above link suggests that it should be is_front_page() but given how bp-default is playing around with that setting in the backened, you might need to check is_home()
@jivany Usually is_home() is for the blog index page.
And I got that on the menu, and is working fine with the blog index page.
I can’t believe something so basic doen’t work.
I am really scratching my head off on this.
Yup, I know is_home() is for the blog page. What I was suggesting was that since is_front_page() doesn’t work (which it should) so maybe try is_home() and see if something isn’t setup properly.
I’m assuming you didn’t create a new page template called “Activity Stream”. In the bp-default functions.php, there are a number of functions that inject the “Activity Stream” option into the drop down box for static “Front Page”. My thought is that this method isn’t setting up something completely so the standard template tags aren’t working.
@jivany Are you suggesting I’d create a tempalte file called Activity and set the front page to that.
If so, should I copy all the stuff from “activity/index.php” into that template file?
That could be a solution, but more of a workaround than a fix, right?
Not sure what this template conditional does but maybe it’s the one we’re missing.
bp_is_activity_front_page()
https://codex.buddypress.org/developer-docs/conditional-template-tags/
Is there anyone that have the slighest idea why this doesn’t work?
By this, I mean “bp_is_front_page()” not being recognized.
@jivany Nope, “bp_is_activity_front_page” doesn’t work neither.
I am on WP single with WP Tempale Pack.
I got the Front page set to Activity stream.
I tried:
1) bp_is_front_page
2) is_front_page
3) bp_is_page(BP_ACTIVITY_SLUG)
4) bp_is_activity_front_page
Neither of those work on the homepage.
I can’t get anything printed out of a conditional statement with the above, meaning I can’t have a “Home” menu highlighted.
Anybody who got this problem?
Open a ticket. There’s something wrong. Make sure you provide as
much detail as possible
Hmm, perhaps it would be better to add the WP regular home/front page conditions to the mix, have not used template pack before in project.
.
<li><?php if ( is_home() || is_front_page() || bp_is_page( 'home' ) || bp_is_front_page() ) : ?> class="active"<?php endif; ?>><a href="<?php echo get_option('home') ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php _e( 'Home', 'buddypress' ) ?></a></li>
@mercime I”l try that… Will let you know.
Well, the only one I didn’t test was bp_is_page( ‘home’ ).
And it doesn’t work neither.
It’s not logical.
I’ve tried to activate the default theme. Same thing,” bp_is_front_page()” is not recognized.
Tried also to deactivate all plugins (except BP). Nothing.
What the hell! Will I ever have an highlighted menu for home when on the homepage?
@gian-ava: Again, open a ticket. It sounds like there is a problem that needs to be fixed.
@gian-ava: Again, open a ticket. It sounds like there is a problem that needs to be fixed.
@21cdb Looks like your link explain my problem. Just… what is BP Trank. In your lijk they talk about “running a trunk”.
@21cdb Looks like your link explain my problem. Just… what is BP Trank. In your lijk they talk about “running a trunk”.
Trunk is the base SVN version. If you’re grabbing BP via SVN then you’re getting whatever is on the trunk. If you’re downloading BP via the regular channels (direct download from teh BP home page or via WP plugins), you have a released version.
Trunk is the base SVN version. If you’re grabbing BP via SVN then you’re getting whatever is on the trunk. If you’re downloading BP via the regular channels (direct download from teh BP home page or via WP plugins), you have a released version.
Thanks jivany! I see. Anyway, I’ve installed BP from the plugins panel in WP admin. So it is a released version.
I am amazed that nobody else got this problem. If it’s in the release version, how can I be the only one having or complaining about this?