Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $args = array('post_type' => 'post', 'hierarchical' => 1, 'cat' => $category[0]->term_id, 'showposts' => 10, 'orderby' => 'date', 'order' => 'DESC', 'no_found_rows' => 'true', '_shuffle_and_pick' => 8 );
- $ultimas = new WP_Query( $args );
- if( $ultimas->have_posts() ) : ?>
- <section class="bn-section bn-section--cat-galeria">
- <div class="container">
- <header class="bn-header-section">
- <h2 class="bn-header-section__title">Últimas notícias</h2>
- </header>
- <div class="owl-carousel" id="owl-carousel-categorias">
- <?php while ( $ultimas->have_posts() ) : $ultimas->the_post();
- $category = get_the_category();
- $value = rwmb_meta( 'cat_color', array( 'object_type' => 'term' ), $categories[0]->term_id );
- //$tipo = get_post_type(get_the_ID());
- $titulo_destaque = get_post_meta( get_the_id(), 'subtitulo', true);?>
- <article class="bn-card-ultimas">
- <figure class="bn-card-ultimas__figure">
- <a href="<?php the_permalink(); ?>" class="bn-card-ultimas__link">
- <?php thumblazy(get_the_ID(), 'thumb-400x400', 'fade thumb', get_the_title()); ?>
- </a>
- <?php get_template_part('templates/share'); ?>
- </figure>
- <div class="bn-card-ultimas__legend">
- <div class="bn-card-ultimas__head">
- <a class="bn-card-ultimas__cat" style="color: <?php echo ($value ? $value : '#ccc'); ?>" href="<?php echo get_category_link( $category[0]->term_id );?>">
- <?php echo $category[0]->name;?>
- </a>
- <div class="bn-card-ultimas__date"><i class="dot fa fa-circle" aria-hidden="true"></i><?php echo get_the_date();?></div>
- </div>
- <a href="<?php echo get_the_permalink(); ?>" title="<?php echo get_the_title(); ?>">
- <h2 class="bn-card-ultimas__title">
- <?php the_title(); ?>
- </h2>
- </a>
- <a href="<?php echo get_the_permalink(); ?>" title="<?php echo $titulo_destaque; ?>">
- <div class="bn-card-ultimas__subtitle">
- <?php echo $titulo_destaque; ?></div>
- </div>
- </a>
- </article>
- <?php endwhile; ?>
- </div>
- </div>
- </section>
- <?php endif; wp_reset_postdata(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement