- This topic has 26 replies, 3 voices, and was last updated 5 years, 5 months ago by
Tom.
-
AuthorPosts
-
October 20, 2020 at 2:03 pm #1497653
Carsten
Sorry, no difference
October 21, 2020 at 8:51 am #1498631Tom
Lead DeveloperLead DeveloperAny chance you can provide temporary admin login details so I can take a closer look?
October 21, 2020 at 8:56 am #1498640Carsten
Sure, thanks for looking into this.
October 21, 2020 at 12:58 pm #1498897Tom
Lead DeveloperLead DeveloperPerhaps that conditional from BP isn’t working.
Does this add anything to the page?:
add_action( 'generate_before_header', function() { if ( function_exists( 'bp_is_activity' ) && bp_is_activity() ) { echo 'activity page'; } } );October 21, 2020 at 1:05 pm #1498911Carsten
No, sorry
October 22, 2020 at 9:02 am #1500167Tom
Lead DeveloperLead DeveloperStrange, all the searching I’ve done points to that being the correct condition.
Can you disable your caching plugin?
October 22, 2020 at 11:24 am #1500330Carsten
Hi there, I appreciate your persistence to solve this issue, but no difference with deactivated cache, and with this code
add_action( 'generate_before_header', function() { if ( function_exists( 'bp_is_activity' ) && bp_is_activity() ) { echo 'activity page'; } } ); add_action( 'bp_before_member_header_meta', 'yzc_add_xprofile_field_data_in_profile_header' );October 22, 2020 at 1:15 pm #1500470Tom
Lead DeveloperLead DeveloperI went into the BuddyPress core code and found when they add the
activityclass to the body.Instead of this:
if ( function_exists( 'bp_is_activity' ) && bp_is_activity() ) {Try this:
if ( function_exists( 'bp_is_activity_component' ) && bp_is_activity_component() ) {October 22, 2020 at 1:37 pm #1500488Carsten
Hi, this code only display the text ‘activity page’ in the header?
How does this code connect the Block Element without id?
add_action( 'generate_before_header', function() { if ( function_exists( 'bp_is_activity_component' ) && bp_is_activity_component() ) { echo 'activity page'; } } );October 23, 2020 at 9:36 am #1501551Tom
Lead DeveloperLead DeveloperThat function is just to test.
Now that we know it works, we can do this:
add_filter( 'generate_block_element_display', function( $display, $element_id ) { if ( 123 === $element_id ) { if ( function_exists( 'bp_is_activity_component' ) && bp_is_activity_component() ) { return true; } } return $display; }, 10, 2 );October 23, 2020 at 11:14 am #1501633Carsten
Hi there, great, it’s working perfectly.
Thanks a lot for bringing up a solution!
How do I get the element contained like the rest of the page?
Block set to to Full width, alternativ is wide width, page content set to contained?Regards
CarstenOctober 24, 2020 at 9:59 am #1502612Tom
Lead DeveloperLead DeveloperIf you want it to be contained then you should de-select the full-width option (you don’t have to choose full width or wide width).
Glad we got it working 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.