• hello Alx
    How can I add google ads between posts in posts page, i found this code

    php
    if ( have_posts() ) :
      $counter = 1; //initialize the counter
      while ( have_posts() ) : the_post();
        if ( $counter % 4 == 0 ):
            // your ad code here
        else:
           get_template_part( 'content', get_post_format() );
        endif;
    
        $counter++; //increment by 1
      endwhile;
    ...
    endif;
    ?>

    Code link
    https://docs.gaslamp.media/insert-ad-posts-wordpress/

    I tried with this code over and over but it didn’t work with the typecore theme
    do you have any idea to make this code work or any code?
    thanks for theme

    The page I need help with: [log in to see the link]

  • The topic ‘How to add ads between posts’ is closed to new replies.