Skip to:
Content
Pages
Categories
Search
Top
Bottom

Add code does not have minimum 250px after tab changed


  • mllapan
    Participant

    @mllapan

    
    /**
    * 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' );

    I am using this code to put Google ad Inside activity stream.
    But, once another tab is clicked, adsense gets error that it does not have minimum 250px to load, and content of tab membes, mentions or whatever will not even load.

  • You must be logged in to reply to this topic.
Skip to toolbar