Forum Replies Created
-
In reply to: “$bp->current_component” returns empty string
https://buddypress.org/support/topic/make-your-own-custom-buddypress-page/.
The snippet I found in the above link is as below:
define('BP_EXAMPLE_SLUG', 'fun'); function bp_show_example_page() { global $bp, $current_blog; if ( $bp->current_component == BP_EXAMPLE_SLUG && $bp->current_action == '' ) { // The first variable here must match the name of your template file below bp_core_load_template( 'fun', true ); } } add_action( 'wp', 'bp_show_example_page', 2 );In reply to: “$bp->current_component” returns empty stringSorry the link is Link. My mistake
In reply to: “$bp->current_component” returns empty stringIn buddypress, activity, members, group have a definite pages like ‘domain/activity’, ‘domain/members’, ‘domain/group’, respectively. Likewise I’m trying to create my own custom page like ‘domain/mycustom’.
For this purpose I referred John James Jacoby’s Post in here. The snippet used in that link didn’t work for me. I don’t know where I’m missing.
From that snippet, I found that
$bp->current_componentreturns me an empty string.In reply to: “$bp->current_component” returns empty string@danbp : Thank You very much for your reply.
Even I’ve tried
bp_current_component()andbp_is_current_component()functions with no success.Actually this function works fine when used in default buddypress pages like
domain/activity/. This returns me “activity”, which is exactly correct. But when I tried this in my custom page (domain/custompage), I’m getting an empty string.