i'm building site on wordpress engine, and I need to display four loops on one page (every one from a different category). I try to write it smart, cause I don't want code to duplicate. Look at this:
As you can see, i don't' want to duplicate code that is in every loop, i mean lines 19-31.
<?php
$events_sep = new WP_Query( array_merge($args_common, $args_sep) );
while ($events_sep->have_posts()) : $events_sep->the_post();
?>
<li class="event-entry date-<?php the_field('event-date'); ?>">
<a href="index.php/<?php the_field('event-venue'); ?>">
<img src="<?php bloginfo('template_url'); ?>/img/program/<?php the_field('event-venue'); ?>-22px.jpg" alt="">
</a>
<?php echo the_content(); ?>
<a class="permalink" href="index.php/<?php the_field('event-venue'); ?>">więcej informacji</a>
<div class="clearfix"></div>
</li>
<?php endwhile; ?>
So i tried saving it as a php variable, but It doesn't worked. I'm not very experienced with php (not as good as javascript), but I can't look at this code, probably you know what I mean ;)