Forum Replies Created

Viewing 8 replies - 46 through 53 (of 53 total)
  • Thread Starter seanjacob

    (@seanjacob)

    Thanks esmi for putting me on the right track, just what I needed.

    esmi some of your code had errors, correction below.

    <?php if (have_posts()) : ?>
    <?php $c = 0;while (have_posts()) : the_post(); $c++;
    if( $c == 3) {
    	$style = 'third';
    	$c = 0;
    }
    else $style='';
    ?>
    <div <?php post_class($style) ?> id="post-<?php the_ID(); ?>">
    Thread Starter seanjacob

    (@seanjacob)

    <!-- the loop-->
    <?php if (have_posts()) : ?>
    
    <!-- new variable for post count -->
    <?php $c = 0; ?>
    
    <!-- begin THE LOOP -->
    <?php while (have_posts()) : the_post();?>
    
    <!--open div class-->
    <?php if( $c == 0) { ?><div class="slider"><?php } ?>
    
    <!-- increments post count with each post -->
    <?php $c++; ?>
    
    <!-- post content -->
    <div class="post"><?php the_content(); ?></div>
    
    <!--close div class-->
    <?php if( $c == 10) {?></div><?php $c = 0;} ?>
    
    <!-- end of the loop-->
    <?php endwhile; else:?><?php endif; ?>
    
    <!-- if not ended on a 10th post close div -->
    <?php if( $c == 10 || $c == 0) {} else {?></div><?php } ?>

    Please let me know if this worked for anyone or if you are having trouble.

    Thread Starter seanjacob

    (@seanjacob)

    <!-- the loop-->
    <?php if (have_posts()) : ?>
    
    <!-- new variable for post count -->
    <?php $c = 0; ?>
    
    <!-- begin THE LOOP -->
    <?php while (have_posts()) : the_post();?>
    
    <!--open div class-->
    <?php if( $c == 0) { ?><div class="slider"><?php } ?>
    
    <!-- increments post count with each post -->
    <?php $c++; ?>
    
    <!-- post content -->
    <div class="post"><?php the_content(); ?></div>
    
    <!--close div class-->
    <?php if( $c == 10) {?></div><?php $c = 0;} ?>
    
    <!-- end of the loop-->
    <?php endwhile; else:?><?php endif; ?>
    
    <!-- if not ended on a 10th post close div -->
    <?php if( $c == 10 || $c == 0) {} else {?></div><?php } ?>

    Please let me know if this worked for anyone or if you are having trouble.

    Thread Starter seanjacob

    (@seanjacob)

    <!-- the loop-->
    <?php if (have_posts()) : ?>
    
    <!-- new variable for post count -->
    <?php $c = 0; ?>
    
    <!-- begin THE LOOP -->
    <?php while (have_posts()) : the_post(); ?>
    
    <!--open div class-->
    <?php if ($c == 0 || $c == 10 || $c == 20 || $c == 30 ) { ?> <div class="slider"> <?php  } ?> 
    
    <!-- increments post count with each post -->
    <?php $c++; ?>
    
    <!-- post content -->
    <div class="post"><?php the_content(); ?></div>
    
    <!--close div class-->
    <?php if ($c == 10 || $c == 20 || $c == 30 ) { ?> </div> <?php  } ?>  
    
    <!-- end of the loop-->
    <?php endwhile; else:?>

    Obvious problem doesn’t go to infinity,

    And a bigger problem is that the div will not close if not a 10th post, so if the post is like 24 will not be able to close the div. But I am sure ill find a work around and update.

    Thread Starter seanjacob

    (@seanjacob)

    <!-- the loop-->
    <?php if (have_posts()) : ?>
    
    <!-- new variable for post count -->
    <?php $c = 0; ?>
    
    <!-- begin THE LOOP -->
    <?php while (have_posts()) : the_post(); ?>
    
    <!--open div class-->
    <?php if ($c == 0 || $c == 10 || $c == 20 || $c == 30 ) { ?> <div class="slider"> <?php  } ?> 
    
    <!-- increments post count with each post -->
    <?php $c++; ?>
    
    <!-- post content -->
    <div class="post"><?php the_content(); ?></div>
    
    <!--close div class-->
    <?php if ($c == 10 || $c == 20 || $c == 30 ) { ?> </div> <?php  } ?>  
    
    <!-- end of the loop-->
    <?php endwhile; else:?>

    Obvious problem doesn’t go to infinity,

    And a bigger problem is that the div will not close if not a 10th post, so if the post is like 24 will not be able to close the div. But I am sure ill find a work around and update.

    Thread Starter seanjacob

    (@seanjacob)

    I think there might be something wrong with <?php get_header(); ?> because when I put everything in the index.php file and have no get_header it works fine.

    have you downloaded the additional plugin for galleryview?

Viewing 8 replies - 46 through 53 (of 53 total)