Created
October 4, 2018 19:51
-
-
Save luisfelipe-dev/2a7ee79a349297d378eeffe01c470d90 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="pagina-interna-imprensa__materias"> | |
| <?php | |
| $related = get_posts( array( 'category__in' => wp_get_post_categories($post->ID), 'numberposts' => 2,'post_type' => 'imprensa', 'post__not_in' => array($post->ID) ) ); | |
| if( $related ) foreach( $related as $post ) { | |
| setup_postdata($post); | |
| ?> | |
| <h2>Matérias Relacionadas</h2> | |
| <div class="d-flex"> | |
| <div class="item-materia-relacionada <?= $category_slug; ?>"> | |
| <div class="foto-destaque"> | |
| <a href="<?php the_permalink(); ?>"> | |
| <img src="<?php echo(get_the_post_thumbnail_url($loop->post->ID)); ?>" alt="<?php echo($loop->post->post_title) ?>" title="<?php echo($loop->post->post_title) ?>"> | |
| </a> | |
| <div class="data-materia"> | |
| <span> | |
| <p> | |
| <strong><?php echo get_the_date('j'); ?></strong> | |
| </p> | |
| <p> | |
| <?php echo get_the_date('F'); ?> | |
| </p> | |
| </span> | |
| </div><!-- /data-materia --> | |
| </div><!-- /foto-destaque --> | |
| <div class="item-materia-relacionada__titulo"> | |
| <div class="d-flex"> | |
| <div class="item-categoria"> | |
| <p><?php echo $category_name; ?></p> | |
| </div><!-- /item-categoria --> | |
| <div class="redes-imprensa"> | |
| <a href="#"><i class="fab fa-facebook-f"></i></a> | |
| <a href="#"><i class="far fa-envelope"></i></a> | |
| </div><!-- /redes-imprensa --> | |
| <div class="item-titulo"> | |
| <a href="<?php the_permalink(); ?>"> | |
| <h3><?php the_title(); ?></h3> | |
| </a> | |
| </div><!-- /item-titulo --> | |
| <div class="item-autor"> | |
| <p><strong>Estadão</strong> - Vanessa Rabello</p> | |
| </div><!-- /item-autor --> | |
| </div><!-- /d-flex --> | |
| </div><!-- /item-materia-relacionada__titulo --> | |
| </div><!-- /item-materia-relacionada --> | |
| </div><!-- /d-flex --> | |
| <div class="carregar-materias"> | |
| <a href="<?php $categories = get_the_category(); | |
| $category_link = get_category_link($categories[0]); | |
| echo esc_url($category_link); ?>"> | |
| Carregar Mais | |
| </a> | |
| </div><!-- /carregar-materias --> | |
| <?php } | |
| wp_reset_postdata(); ?> | |
| </div><!-- /pagina-interna-imprensa__materias --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment