Advertisement
Guest User

Untitled

a guest
Apr 16th, 2016
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.69 KB | None | 0 0
  1.  
  2.  
  3.             <?php
  4.             $the_query = new WP_Query(array(
  5.                 'post_type'         => 'revista-rbac',
  6.                 'posts_per_page'    => 1,
  7.                 'meta_key'          => 'titulo-revista',
  8.                 'orderby'           => 'titulo-revista',
  9.                 'order'             => 'DESC'
  10.             ));
  11.             while( $the_query->have_posts() ) : $the_query->the_post(); ?>
  12.                 <div class="img-capa">
  13.                     <p>Capa:</p>
  14.                     <a href="<?php echo the_field( 'capa' ); ?>">
  15.                         <img src="<?php echo the_field( 'capa' ); ?>">
  16.                     </a>
  17.                 </div>
  18.                 <h1><?php echo the_field( 'titulo-revista' ); ?></h1>
  19.                 <div class="sumario"><?php echo the_field( 'sumario' ); ?></div>
  20.                 <div class="indexadores"><?php echo the_field( 'indexadores' ); ?></div>
  21.                 <?php if( have_rows('bloco') ): while ( have_rows('bloco') ) : the_row();
  22.                     echo '<div class="bloco-de-artigos">';
  23.                         echo '<div class="titulo-bloco">';
  24.                             the_sub_field('titulo-bloco');
  25.                         echo '</div>';
  26.                         $post_objects = get_sub_field('artigos');
  27.                         if( $post_objects ): foreach( $post_objects as $post): setup_postdata($post); ?>
  28.                             <div class="item">
  29.                                 <h2><a class="titulo-artigo" href="<?php the_permalink(); ?>"><?php echo the_field( 'titulo-artigo' ); ?> </a></h2>
  30.                                 <?php if( have_rows('autor') ) :
  31.                                     echo '<div class="autor">';
  32.                                         while ( have_rows('autor') ) : the_row();
  33.                                             echo '<p class="nome-autor">';
  34.                                                 the_sub_field('nome-autor');
  35.                                             echo '</p>';
  36.                                         endwhile; //have_rows(autor)
  37.                                     echo '</div>';
  38.                                 endif;?> <!-- have_rows(autor) -->
  39.                                 <?php if( get_field('resumo-texto') ): ?>
  40.                                 <div class="resumo-texto-bloco">
  41.                                     <h3>Resumo</h3>
  42.                                     <div class="resumo-texto">
  43.                                         <?php echo the_field( 'resumo-texto' ); ?>
  44.                                     </div>
  45.                                 </div>
  46.                                 <?php endif; //<?php if( get_sub_field('resumo-texto') ): ?>
  47.                                 <a class="resumo-port" href="<?php echo the_field( 'resumo-port' ); ?>" target="_blank">Resumo em português (PDF)</a><br/>
  48.                                 <a class="resumo-ing" href="<?php echo the_field( 'resumo-ing' ); ?>" target="_blank">Resumo em inglês (PDF)</a><br/>
  49.                                 <a class="texto-completo" href="<?php echo the_field( 'texto-completo' ); ?>" target="_blank">Texto completo (PDF)</a><br/>
  50.                             </div> <!-- fim item -->
  51.                         <?php endforeach;
  52.                         endif; //if( $post_objects ): foreach( $post_objects as $post): setup_postdata($post);
  53.                     echo '</div>'; //fim bloco-de-artigos
  54.                 endwhile;
  55.                 endif; //<?php if( have_rows('bloco') ): while ( have_rows('bloco') ) : the_row();
  56.             endwhile;
  57.             wp_reset_postdata(); // IMPORTANT - reset the $post object so the rest of the page works correctly
  58.             ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement