Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php get_header(); ?>
- <div class="row">
- <div class="large-4 columns">
- <?php get_sidebar(); ?>
- </div>
- <div class="large-8 columns">
- <h4>Últimas notícias</h4>
- <ul class="no-bullet">
- <?php
- $args = array (
- 'category_name' => 'noticias',
- 'pagination' => true,
- 'posts_per_page' => '5',
- );
- $query = new WP_Query( $args );
- // Loop
- if ( $query->have_posts() ) {
- while ( $query->have_posts() ) { $query->the_post();
- ?>
- <li class="panel">
- <h5>
- <a href="<?php the_permalink();?>"><?php the_title() ?>
- </h5>
- <p class="post-info"><?php the_time('F j, Y'); ?> | Por <a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>"><?php the_author(); ?></a> | Postado em
- <?php
- $categories = get_the_category();
- $separator = ", ";
- $output = '';
- if ($categories) {
- foreach ($categories as $category) {
- $output .= '<a href="' . get_category_link($category -> term_id) . '">' . $category -> cat_name . '</a>' . $separator;
- }
- echo trim($output, $separator);
- }
- ?>
- </p>
- <hr />
- <p> <?php the_excerpt() ?> </p>
- <a href="<?php the_permalink();?>" class="button radius">Ver notícia completa</a>
- </li>
- <!-- End of the Loop -->
- <li>
- <ul>
- <li><?php next_posts_link( 'Older posts' ); ?></li>
- <li><?php previous_posts_link( 'Newer posts' ); ?></li>
- </ul>
- </li>
- <?php } } else { ?>
- <h5>Não foi encontrado o conteúdo desejado!</h5>
- <?php } wp_reset_postdata(); ?>
- </ul>
- </div>
- </div>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement