[Resolved] 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? 🙂
- The topic ‘[Resolved] Combining php and html’ is closed to new replies.