Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $the_query = new WP_Query(array(
- 'post_type' => 'revista-rbac',
- 'posts_per_page' => 1,
- 'meta_key' => 'titulo-revista',
- 'orderby' => 'titulo-revista',
- 'order' => 'DESC'
- ));
- while( $the_query->have_posts() ) : $the_query->the_post(); ?>
- <div class="img-capa">
- <p>Capa:</p>
- <a href="<?php echo the_field( 'capa' ); ?>">
- <img src="<?php echo the_field( 'capa' ); ?>">
- </a>
- </div>
- <h1><?php echo the_field( 'titulo-revista' ); ?></h1>
- <div class="sumario"><?php echo the_field( 'sumario' ); ?></div>
- <div class="indexadores"><?php echo the_field( 'indexadores' ); ?></div>
- <?php if( have_rows('bloco') ): while ( have_rows('bloco') ) : the_row();
- echo '<div class="bloco-de-artigos">';
- echo '<div class="titulo-bloco">';
- the_sub_field('titulo-bloco');
- echo '</div>';
- $post_objects = get_sub_field('artigos');
- if( $post_objects ): foreach( $post_objects as $post): setup_postdata($post); ?>
- <div class="item">
- <h2><a class="titulo-artigo" href="<?php the_permalink(); ?>"><?php echo the_field( 'titulo-artigo' ); ?> </a></h2>
- <?php if( have_rows('autor') ) :
- echo '<div class="autor">';
- while ( have_rows('autor') ) : the_row();
- echo '<p class="nome-autor">';
- the_sub_field('nome-autor');
- echo '</p>';
- endwhile; //have_rows(autor)
- echo '</div>';
- endif;?> <!-- have_rows(autor) -->
- <?php if( get_field('resumo-texto') ): ?>
- <div class="resumo-texto-bloco">
- <h3>Resumo</h3>
- <div class="resumo-texto">
- <?php echo the_field( 'resumo-texto' ); ?>
- </div>
- </div>
- <?php endif; //<?php if( get_sub_field('resumo-texto') ): ?>
- <a class="resumo-port" href="<?php echo the_field( 'resumo-port' ); ?>" target="_blank">Resumo em português (PDF)</a><br/>
- <a class="resumo-ing" href="<?php echo the_field( 'resumo-ing' ); ?>" target="_blank">Resumo em inglês (PDF)</a><br/>
- <a class="texto-completo" href="<?php echo the_field( 'texto-completo' ); ?>" target="_blank">Texto completo (PDF)</a><br/>
- </div> <!-- fim item -->
- <?php endforeach;
- endif; //if( $post_objects ): foreach( $post_objects as $post): setup_postdata($post);
- echo '</div>'; //fim bloco-de-artigos
- endwhile;
- endif; //<?php if( have_rows('bloco') ): while ( have_rows('bloco') ) : the_row();
- endwhile;
- wp_reset_postdata(); // IMPORTANT - reset the $post object so the rest of the page works correctly
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement