WordPress.org

Ready to get started?Download WordPress

Forums

Loop distracts when i navigate to page 3+ through paging ? (2 posts)

  1. mayur6578
    Member
    Posted 1 year ago #

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

    Index page : http://www.themesbag.com/
    Index page 2: http://www.themesbag.com/page/2/
    Index page 3: http://www.themesbag.com/page/3/
    Index page 4: http://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)

  2. mayur6578
    Member
    Posted 1 year ago #

    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(); ?>">

Topic Closed

This topic has been closed to new replies.

About this Topic