How do i add div tags for specific posts only?
-
Hi,
I’m creating a theme from scratch. I have a one page parallax website. i have 5 posts which are being used as pages to create the single page website look (scrolling website).
Out of the 5 posts, I want to add div tags to 2 of the posts. Does anyone know how to go about that one. I have been trying to work this one out for ages but cat seem to find a solution.
I have it working but its not correct, the way Ive done it is that it ends up adding div tags for every post even if that post does not require it.
This is what I have so far:<?php query_posts('posts_per_page&order=ASC'); while(have_posts()) : the_post(); ?> <section class = "container" id="<?php echo get_the_title(); ?>"> <article class = "row <?php echo get_the_title(); ?>"> <?php the_content(); ?> <?php for($i=0; $i<5; $i++){ $x = $i; ?> <div id="<?php echo get_the_title(). $x; ?>"></div> <?php } ?> </article> </section> <?php endwhile; wp_reset_query(); ?>
Raj
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘How do i add div tags for specific posts only?’ is closed to new replies.