Advertisement
Guest User

Untitled

a guest
Jan 30th, 2015
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. <div id="ultima-edicao">
  2. <h1>ULTIMAS EDIÇÕES</h1>
  3.  
  4. <?php
  5.  
  6. $args = 'cat=39&posts_per_page=5';
  7.  
  8. $the_query = new WP_Query($args);
  9.  
  10. if($the_query->have_posts() ) {
  11. echo '<ul class="ultima-edicao">';
  12. // while the custom query have posts, it will add the posts and it's thumbnails into a list item tag
  13.  
  14. while($the_query->have_posts() ) {
  15. // the_content();
  16. // $the_query->the_post();
  17. echo '<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">';
  18. the_post_thumbnail();
  19. echo '</a>';
  20. ?>
  21.  
  22.  
  23.  
  24.  
  25.  
  26. <?php
  27. }
  28. ?>
  29.  
  30. <?php
  31.  
  32. echo '</ul>';
  33. }else{
  34. echo 'Nenhum post foi encontrado.';
  35. }
  36. // Restore original post data
  37. wp_reset_postdata();
  38. ?>
  39. </div><!-- #latest-category-posts -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement