Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="ultima-edicao">
- <h1>ULTIMAS EDIÇÕES</h1>
- <?php
- $args = 'cat=39&posts_per_page=5';
- $the_query = new WP_Query($args);
- if($the_query->have_posts() ) {
- echo '<ul class="ultima-edicao">';
- // while the custom query have posts, it will add the posts and it's thumbnails into a list item tag
- while($the_query->have_posts() ) {
- // the_content();
- // $the_query->the_post();
- echo '<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">';
- the_post_thumbnail();
- echo '</a>';
- ?>
- <?php
- }
- ?>
- <?php
- echo '</ul>';
- }else{
- echo 'Nenhum post foi encontrado.';
- }
- // Restore original post data
- wp_reset_postdata();
- ?>
- </div><!-- #latest-category-posts -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement