WP_query to create multiple loops (category columns)


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php $my_query = new WP_Query('category_name=fotografia&showposts=3'); ?>
  2. <?php if (have_posts()) : while ($my_query->have_posts()) : $my_query->the_post(); ?>
  3.  
  4. <?php the_title(); ?>
  5. <?php the_content(); ?>
  6.  
  7. <?php endwhile;
  8. endif;
  9. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.