Advertisement
viktormorales

Wordpress: Loop secundario

Jul 11th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <article id="entradas">
  2. <?php
  3. $args = "posts_per_page=4&cat=38";
  4. $query = new WP_Query($args);
  5. if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); ?>
  6. <h3 class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Enlace permanente a <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
  7. <article id="thumbs">
  8. <?php
  9. if ( has_post_thumbnail() ) {
  10. the_post_thumbnail();
  11. }
  12. ?>
  13. </article>
  14.  
  15. <?php the_excerpt(); ?>
  16. <?php endwhile; else: ?>
  17. <p><?php _e('No hay entradas .'); ?></p>
  18. <?php endif; ?>
  19. </article>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement