Replies
Viewing 4 posts - 1 through 4 (of 4 total)
thanks for the reply
well i customize a bit but i have also tried it with the original code you gave but problem still exist. well the problem is that when you are on site wide activity stream when you click on my friend activity it shows a blank page and until you refresh
ok i am sharing the code i am using.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 ( !is_user_logged_in()){ //i added it to show ads only to non-logged in user if ( $current_activity_index % $n === 0 ) { ?> <div class="activity-avatar"> <div class="names"style="color:#c92e2e;">Sponsored</div> <div class="nices-name">@sponsored</div> </div> <div class="activity-content"> <div class="ads"><script async adsense code //this the adsense script </script></div> </div><?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' );
Viewing 4 posts - 1 through 4 (of 4 total)