seanjacob
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How would I go about doing this…Thanks esmi for putting me on the right track, just what I needed.
Forum: Themes and Templates
In reply to: Adding a different class to every third post?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(); ?>">
Forum: Themes and Templates
In reply to: LOOP: Put a class around every 10 posts.<!-- 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.
Forum: Fixing WordPress
In reply to: LOOP: Put a class around every 10 posts.<!-- 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.
Forum: Fixing WordPress
In reply to: LOOP: Put a class around every 10 posts.<!-- 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.
Forum: Themes and Templates
In reply to: LOOP: Put a class around every 10 posts.<!-- 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.
Forum: Fixing WordPress
In reply to: Everything in head is going in body!!!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.
Forum: Plugins
In reply to: [Plugin: NextGEN Gallery] ngg galleryviewhave you downloaded the additional plugin for galleryview?