Listar posts em Author.php
-
Boa tarde!!
Criei um Post Type chamado artigos e quero exibi-los na página do autor, author.php.
Já peguei as informações do autor, etc… estou usando o seguinte código:<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class="artigosprof"> <a href="<?php the_permalink();?>"><?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?></a> <h3><a href="#" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3> </div> <?php endwhile; ?> <?php endif; ?>
Este retorna posts, mas no meu caso eu quero o Post Type Artigos. Pra resolver isso eu tentei da seguinte maneira:
<?php $newsArgs = array( 'post_type' => 'artigos', 'posts_per_page' => 8); $newsLoop = new WP_Query( $newsArgs ); while ( $newsLoop->have_posts() ) : $newsLoop->the_post(); ?> <div class="artigosprof"> <a href="<?php the_permalink();?>"><?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?></a> <h3><a href="#" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3> </div> <?php endwhile; ?>
Neste caso lista os artigos mas o problema é que não sei como filtrar para que apareça apenas os artigos deste autor.
Desde já agradeço qualquer ajuda.
Visualizando 2 respostas - 1 até 2 (de um total de 2)
Visualizando 2 respostas - 1 até 2 (de um total de 2)
- O tópico ‘Listar posts em Author.php’ está fechado para novas respostas.