Advertisement
Marquinhus

category-nomedacategoria.php

Sep 3rd, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.16 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3. <div class="banner banner_empresa">
  4.     <img src="<?php bloginfo('stylesheet_directory');?>/img/banners/banner_home.jpg" alt="">
  5. </div>
  6.  
  7. <div class="container">
  8.     <div class="col-sm-12">
  9.         <?php
  10.         $args = array(
  11.             'category'      => '5',
  12.             'posts_per_page'    => 4,
  13.             'orderby'           => 'post_date',
  14.             'order'             => 'DESC',
  15.             'post_status'       => 'publish'
  16.             );
  17.         $temp = $wp_query;  // assign orginal query to temp variable for later use
  18.         $wp_query = null;
  19.         $wp_query = new WP_Query($args);
  20.         if( have_posts() ) :
  21.             while ($wp_query->have_posts()) : $wp_query->the_post();
  22.         ?>
  23.         <div class="col-sm-6 list-post-category">
  24.             <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
  25.             <div class="post-category">
  26.                 <p><?php echo wp_trim_words( get_the_content(), 25 ); ?></p>
  27.                 <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php _e( '<i class="fa fa-hand-o-right"></i> Clique aqui e leia mais' ); ?></a>
  28.             </div>  
  29.         </div>
  30.  
  31.     <?php endwhile;
  32.  
  33.     else :
  34.         echo '<p> Nenhum artigo encontrado </p>';
  35.  
  36.     endif; ?>
  37.     <?php pagination(); ?>
  38.  
  39. </div>
  40.  
  41. </div>
  42.  
  43. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement