They do not load the data of the custom type

0

Good morning, I do not know why they do not load the data of the custom type and the wordpress page is blank, this is the code:

<div class="contenido-portada">
<?php $argumentos = array(
      'post-type'=>'slider'
      'category_name' => 'sliderhome',
      'post_per_page'=> 5,
      'orderby'=> 'date',
      'order'=>'ASC'); ?>
    <?php $slider = new WP_Query($argumentos); 
    while($slider->have_posts()): $slider->the_post();
    ?>
      <?php $url = wp_get_attachment_url(get_post_thumbnail_id($post->ID)); ?>

      <div class="slider" style="background-image:url(<?php echo $url; ?>); background-size: cover;">
        <p><?php the_title(); ?></p>
        <h1><?php the_content(); ?></h1>
        <a href="<?php the_field('link_de_slider') ?>">More</a>
        </div>
    
    <?php endwhile; wp_reset_postdata(); ?>
</div>
    
asked by Luis Morales Ponce 05.04.2017 в 17:07
source

2 answers

3

The syntax problem is in the array $ arguments in the 'post-type', you must change it to 'post_type' and add the comma when the 'slider' value ends in the same line.

It should look like this:

<?php $argumentos = array(
      'post_type'=>'slider',
      'category_name' => 'sliderhome',
      'post_per_page'=> 5,
      'orderby'=> 'date',
      'order'=>'ASC'); ?>

I recommend that when you are developing with Wordpress you enable the debug mode in the file wp-config.php modify the following line to true:

define(‘WP_DEBUG’, true);

Try it and tell me.

    
answered by 05.04.2017 / 17:16
source
0

Change

'post-type'=>'slider'

By

'post_type'=>'slider',

is with a low script and you lack the comma at the end, that may be the problem

    
answered by 05.04.2017 в 17:27