Combining php and html
-
Hello! Great plugin!
I want to combine php and html in my shortcode. This is what I have done:
?><div id="tjanster"> <?php $i=1; ?> <?php query_posts('category_name=tjanster'); ?> <?php if (have_posts()) : while (have_posts()) : the_post();?> <div class="tjanster_post tjanster_nr_<?php echo $i ?>"> <?php the_content(); ?> </div> <?php $i++; ?> <?php endwhile; endif; ?> </div>
[Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
And it works almost perfectly. The problem is that it goes through the loop twice. The first time it reads the html and the second time it doesnt. What can i do to solve this? 🙂
Regards,
Anna
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Combining php and html’ is closed to new replies.