<?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ global $post; $cat = getOneCat(); $categories = get_the_category(); $nomeCat = $categories[0]; $nomeCat = $nomeCat->name; //debug($nomeCat); $args = array('post_type' => array('post', 'artigo'), 'posts_per_page' => 3, 'order' => 'DESC', 'orderby' => 'date', 'category_name' => $nomeCat); // The Query $the_query = new WP_Query($args); ?> <div class="last-3"> <?php if ($the_query->have_posts()) { ?> <?php while ($the_query->have_posts()) { $the_query->the_post(); ?> <a href="<?php echo get_permalink(); ?> "> <div class="item ">
post_class(); ?> > <div class="capa-single"> <?php the_post_thumbnail(); ?> <?php if (getOneCat()) { ?> <p class="cat-flag tipo9 <?php echo getOneCat(); ?> "><?php echo getOneCat(); ?> </p> <?php } ?> </div> <?php the_title('<h1 class="">', '</h1>'); ?> <!-- Go to www.addthis.com/dashboard to customize your tools --> <div class="addthis_sharing_toolbox"></div>
function getPost() { global $post; ?> <div id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <a href="<?php the_permalink(); ?> "> <?php if (has_post_thumbnail()) { ?> <div class="post-with-thumb"> <?php the_post_thumbnail('capa-thumb'); ?> <div class="post-capa-hover item-hover"> </div> <?php the_title('<h2 class="item31 item-hover">', '</h2>'); ?> <p class="cat-flag tipo9 <?php echo getOneCat(); ?> "><?php echo getOneCat(); ?> </p> <p class="post-meta-data item-hover"> <?php vertigemMetaData(); ?> </p> </div> <div class="the_special_excerpt"> <?php the_special_excerpt($post->ID, 70, ' <span class="extra">{...}</span>'); ?> </div> <?php } else { ?> <div class="post-no-thumb"> <?php the_title('<h2 class="item-hover item6">', '</h2>'); ?> <p class="post-meta-data item-hover"> <?php vertigemMetaData(); ?> </p> </div> <div class="the_special_excerpt"> <?php the_special_excerpt($post->ID, 150, '{...}'); ?> </div> <?php } ?> </a> </div> <?php }