Find Answers and Get Support › Forums › Cera – Intranet & Community Theme › Feature Requests › adv/content in activity steam
Tagged: Declined
- This topic has 8 replies, 4 voices, and was last updated 3 years, 11 months ago by
Themosaurusrex.
-
AuthorPosts
-
AndreaParticipant@youfriend
- 26 Topics
- 133 Posts
Up::0For add extra content or ads in the activity stream i have found this amazing post, but
Unfortunately not work with Adsense. any ideas?Inject content into BuddyPress Activity stream after a certain number of activities
code:
/** * Inject content into BuddyPress Activity stream after 'n' activities. */ function buddydev_inject_content_after_n_activities() { static $current_activity_index = 1; // change $n to the correct number of activities. $n = 5; // After how many activities you want to inject content. if ( $current_activity_index % $n === 0 ) { ?> <li class='activity-item activity-ad-item activity-custom-entry'> Your code snippet ... </li> <?php // show the activity injected content. } // increment the current index. $current_activity_index ++; } add_action( 'bp_after_activity_entry', 'buddydev_inject_content_after_n_activities' );
July 6, 2020 at 13:58 #14735@themodactyl- 0 Topics
- 6737 Posts
Hi @youfriend,
Thanks for getting in touch! We’ve received your request and we’ll get you an answer shortly. 🙂
We really thank you for your patience!
Kind regards,
July 7, 2020 at 09:50 #14798@themosaurusrex- 0 Topics
- 2048 Posts
AdSense seams to be very JavaScript based and some other code is probably messing with your snippet. I have reached this conclusion after reading this:
https://www.wpbeginner.com/beginners-guide/how-to-add-google-adsense-to-your-wordpress-site/Do you have AdSense already activated on your website? And does it work in your sidebar widget areas?
Thank you.
July 8, 2020 at 11:46 #14927AndreaParticipant@youfriend- 26 Topics
- 133 Posts
Im try this snippet, work but just for 1 adv after 5 activities (better of nothing)
function custom_markup_before_every_fifth_activity() { global $activities_template; $item_5 = $activities_template->activities[4]; if ( $item_5->id === $activities_template->activity->id ) { echo 'adv here'; } }; add_action( 'bp_before_activity_entry', 'custom_markup_before_every_fifth_activity' );
July 8, 2020 at 13:22 #14939@themosaurusrex- 0 Topics
- 2048 Posts
@youfriend Thank you for sharing your findings with the rest of us!
I went through the following posts:how to make this code work properly to put ads in buddypress activity
https://wordpress.org/support/topic/buddypress-ad-placements/I also stumbled upon this plugin but it has very few active installations and I haven’t had the chance to test it with Cera:
My conclusion is that there is not much we can do with our theme because I haven’t found any plugin or any simpler ways to achieve this. Any attempt to insert AdSense adds into the BuddyPress activity stream require custom coding…
Maybe this topic will spark others interest and we could decide in the future to implement this feature in a plugin ourselves if other community members upvote your request. So, I think that we should leave this open for further comments.
Please note that I took the liberty to move this topic to our Feature Requests forum. 🙂
July 13, 2020 at 16:31 #15199@themosaurusrex- 0 Topics
- 2048 Posts
Hi,
Thank you for sharing this idea with our community.
Your idea would have been a nice addition to our theme but unfortunately, this feature request hasn’t received any upvote from other community members in months. Sadly, we have to decline it as we are trying to keep this forum tidy.
We really appreciate your enthusiasm when using our products. Feel free to keep on sharing other ideas that might be integrated in the future.
Best regards,
April 27, 2021 at 09:39 #31048 -
AuthorPosts
The topic ‘adv/content in activity steam’ is closed to new replies.