How to put custom post type on slide

0

I have the Custom post type code and wanted to put this same code inside of that slide but I can not, could you help me?

The code of the custom post type that I want to be inside the slide is this:

  <?php
                $loop = new WP_Query( array( 'post_type' => 'Slider','showposts' => 10 ) );
                while ( $loop->have_posts() ) : $loop->the_post();
                $custom = get_post_custom($post->ID);  
                $qd_slider_url = $custom["qd_slider_url"][0];
                $qd_slider_target = $custom["qd_slider_target"][0];
                if($qd_slider_target == 0){ $qd_slider_target = "_top";}
                if($qd_slider_target == 1){ $qd_slider_target = "_blank";}
            ?>


                <div class="slide"> <?php the_post_thumbnail('banner_home'); ?></div>
            <?php endwhile; ?>

The code below is what is in my functions.php, it makes the slide work

   add_action('init', 'slider_registrer');
function slider_registrer(){
     $labels = array(
        'name' => _x('slider', 'post type general name'),
        'singular_name' => _x('slider', 'post type singular name'),
        'add_new' => _x('Adicionar slider', 'slider'),
        'add_new_item' => __('Adicionar slider'),
        'edit_item' => __('Editar slider'),
        'new_item' => __('Novo slider'),
        'view_item' => __('Ver slider'),
        'search_items' => __('Procurar slider'),
        'not_found' =>  __('Nada encontrado'),
        'not_found_in_trash' => __('Nada encontrado no lixo'),
        'parent_item_colon' => ''
    );
    $args = array(
        'labels' => $labels,
        'public' => true,
        'publicly_queryable' => true,
        'show_ui' => true,
        'query_var' => true,
        'rewrite' => true,
        'has_archive' => true,
        'menu_icon' => 'dashicons-video-alt3',
        'capability_type' => 'post',
        'hierarchical' => false,
        'menu_position' => 15,
        'supports' => array('title','thumbnail'),
      );
    register_post_type('slider',$args);
} 
    
asked by anonymous 23.06.2018 / 01:52

0 answers