Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. <?php
  2. $how_often_to_show_widget = 2;
  3.  
  4. if (have_posts()) :
  5.     $post_count = 0;
  6.     while (have_posts()) : $post_count++;
  7.         the_post();
  8.  
  9.  
  10.         if (is_active_sidebar('inter-posts-1') && $post_count % $how_often_to_show_widget == 0): ?>
  11.             <div class="widget-area">
  12.                 <?php dynamic_sidebar('inter-posts-1'); ?>
  13.             </div>
  14.         <?php endif; ?>
  15.  
  16.  
  17.         <?php get_template_part('template-parts/post/content', get_post_format());
  18.  
  19.     endwhile;
  20. endif;
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement