Title: Thumbnails em Custom Post Types não funcionam
Last modified: 6 agosto, 2016

---

# Thumbnails em Custom Post Types não funcionam

 *  [Amaral](https://br.wordpress.org/support/users/leoamrl/)
 * (@leoamrl)
 * [10 anos, 4 meses atrás](https://br.wordpress.org/support/topic/thumbnails-em-custom-post-types-nao-funcionam/)
 * Tentei adicionar Thumbnails em um Custom Post Type mas nem funciona.
    Alguém 
   já passou por isso e sabe resolver? Segue código. VLW
 * FUNCTIONS
 *     ```
       add_action( 'init', 'create_post_type' );
       function create_post_type() {
         register_post_type( 'eventos',
       	array(
       	  'labels' => array(
       		'name' => __( 'Eventos' ),
       		'singular_name' => __( 'Eventos' )
       	  ),
       	  'public' => true,
       	)
         );
   
       }
   
       register_taxonomy(
       "categorias",
       	  "eventos",
       	  array(
       		"label" => "Categorias",
       			"singular_label" => "Categoria",
       			"rewrite" => true,
       			"hierarchical" => true
       )
       );
   
       add_theme_support( 'post-thumbnails', array( 'post', 'eventos' ) );
       ```
   
 * CHAMANDO O POST
 *     ```
       <?php $newsArgs = array( 'post_type' => 'eventos', 'posts_per_page' => 18);
       				$newsLoop = new WP_Query( $newsArgs );
       				while ( $newsLoop->have_posts() ) : $newsLoop->the_post();?>
   
       				<div class="one-fourth">
       				    <h1><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
       				</div>
   
       			<?php endwhile; ?>
       ```
   

Visualizando 1 resposta (de um total de 1)

 *  [gtw7375](https://br.wordpress.org/support/users/gtw7375/)
 * (@gtw7375)
 * [10 anos, 4 meses atrás](https://br.wordpress.org/support/topic/thumbnails-em-custom-post-types-nao-funcionam/#post-61082)
 * Embaixo de `'public' => true,`
 * adicione isso:
 * `'supports' => array('title','editor', 'thumbnail')`
 * O que ele faz? Ele adiciona o campo do Título, o editor de conteúdo e o campo
   do Thumbnail dentro Custom Post Type.

Visualizando 1 resposta (de um total de 1)

 O tópico ‘Thumbnails em Custom Post Types não funcionam’ está fechado para novas
respostas.

## Tags

 * [Custom Post Types](https://br.wordpress.org/support/topic-tag/custom-post-types/)
 * [thumbnails](https://br.wordpress.org/support/topic-tag/thumbnails/)

 * Em: [Ajustando o WordPress](https://br.wordpress.org/support/forum/resolucao-de-problemas/)
 * 1 resposta
 * 2 participantes
 * Última resposta de: [gtw7375](https://br.wordpress.org/support/users/gtw7375/)
 * Última atividade: [10 anos, 4 meses atrás](https://br.wordpress.org/support/topic/thumbnails-em-custom-post-types-nao-funcionam/#post-61082)
 * Estado: não resolvido

## Tópicos

### Tópicos mais populares

### Tópicos sem respostas

### Tópicos não relacionados a suporte

### Tópicos resolvidos

### Tópicos não resolvidos

### Todos os tópicos
