• Hi,
    This is my website: https://www.themesbag.com
    These are different paging index pages( i don’t know what to call theme)

    Index page : https://www.themesbag.com/
    Index page 2: https://www.themesbag.com/page/2/
    Index page 3: https://www.themesbag.com/page/3/
    Index page 4: https://www.themesbag.com/page/4/

    If you look at main index page and page 2 the layout works fine but don’t understand what happens on page 3 and 4 and onwards…

    i use following code in loop.

    <?php
    		$post_count = 1;
    
    	?>
    	<?php if (have_posts()) : while ( have_posts() ) : the_post() ?>
    		<?php if($post_count <= 2) {
    		include(TEMPLATEPATH. '/includes/loop.php');
    		}
    
    		else {
    
    			while ($post_count == 3)
    			{
    				right_ad();
    				$post_count++;
    			}
    			include(TEMPLATEPATH. '/includes/loop.php');
    			if ($post_count % 3 == 0 ) { echo '<div class="clear"></div>'; }
    
                    } ?>
    
    	<?php $post_count++; endwhile; ?>

    Please help somebody! Help is appreciated. (I Use Table theme of themejunkie)

Viewing 1 replies (of 1 total)
  • Thread Starter mayur6578

    (@mayur6578)

    Resolved;

    <?php
    		$post_count = 1;
    		$ad_count = 1;
    		$temp_count = 1;
    
    	?>
    	<?php if (have_posts()) : while ( have_posts() ) : the_post() ?>
    		<?php
    		if($post_count <= 2) {
    		include(TEMPLATEPATH. '/includes/loop.php');
    		$post_count++;
    
    		}
    		elseif($ad_count == 3) {
    		?> <div class="ad-box entry-last"> <?	ad_right(); ?> </div> <?
    		$post_count++;
    		$temp_count++;
    		echo '<div class="clear"></div>';
    		include(TEMPLATEPATH. '/includes/loop.php');
    
    		}
    		elseif($post_count >= 4) {
    		include(TEMPLATEPATH. '/includes/loop.php');
    		if ($temp_count % 3 == 0) { echo '<div class="clear"></div>'; }
    		$post_count++;
    
    		}
    		?>
    
    	<?php $ad_count++; $temp_count++;  endwhile; ?>

    in the loop.php at begining:
    <a id="post-<?php the_ID(); ?>" class="entry-box <?php if($temp_count % 3 == 0 ) { echo 'entry-last'; } ?>" href="<?php the_permalink(); ?>">

Viewing 1 replies (of 1 total)
  • The topic ‘Loop distracts when i navigate to page 3 through paging ?’ is closed to new replies.