Support only during business hours : Monday to friday, from 8:30 am – 5:30 pm CEST

Due to the decrease in our staff due to vacations, our response time may be longer.

Be sure we're doing our best to manage your topic as soon as possible.

adv/content in activity steam

This request has been declined by the Themosaurus team and will not be implemented

Tagged: 

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • Andrea
    Participant
    • 26 Topics
    • 133 Posts
    @youfriend
    Up
    0
    ::

    For 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' );
    Manathan
    Keymaster
    Themosaurus Support
    • 0 Topics
    • 6297 Posts
    @themodactyl

    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,

    Themosaurusrex
    Keymaster
    Themosaurus Support
    • 0 Topics
    • 2048 Posts
    @themosaurusrex

    @youfriend,

    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.

    Andrea
    Participant
    • 26 Topics
    • 133 Posts
    @youfriend

    yep work it everywhere

    Andrea
    Participant
    • 26 Topics
    • 133 Posts
    @youfriend

    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' );
    Themosaurusrex
    Keymaster
    Themosaurus Support
    • 0 Topics
    • 2048 Posts
    @themosaurusrex

    @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/

    Adsense on activity stream?

    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:

    Buddypress Ads

    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. 🙂

    Muamer
    Participant
    • 13 Topics
    • 33 Posts
    @mllapan

    Any code you try will give you problem when new tab is reloaded, because of FLEXstyling of the theme.
    You will get:
    Fluid responsive ads must be at least 250px wide: availableWidth=0

    Themosaurusrex
    Keymaster
    Themosaurus Support
    • 0 Topics
    • 2048 Posts
    @themosaurusrex

    @mllapan Thank you for providing further info on this!

    Themosaurusrex
    Keymaster
    Themosaurus Support
    • 0 Topics
    • 2048 Posts
    @themosaurusrex

    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,

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘adv/content in activity steam’ is closed to new replies.

Troubleshooting Demo Imports

You're trying to setup your theme but you're experiencing errors when importing the demo content? Or you've just followed the setup guide but your website doesn't look exactly like our demo? These are common issues for which you can find easy and quick fixes.

Happy With our Support So Far?

Feel free to review our theme on Themeforest! It helps us making our products more known to new potential customers, which allow us more time to improve the quality and develop new features. #SharingIsCaring ❤️

Discover MatchPress

Skip • Like • Super-Like

Add powerful matching features like Member likes, skips, super likes, conditional private messaging and much more.

Setup Your Cera or Gwangi powered Community Website and Turn it into an iOS and Android App

15% discount for Cera users

To unleash the full power of your Cera or Gwangi theme, we have partnered with the Zipline team. Your community website can now be fully setup and turned into your very own custom app for iOS and Android.

Whether you've newly acquired the theme or already got your site up and running, Zipline got you covered. And we got you an incredible discount.

Holiday, Weather & Festive effects
to pimp your WordPress Site