Michel
Michel

Reputation: 41

wordpress custom post loop not working - not displaying any content

I have a custom post type created with Pods plugin labelled "Camere" plural and "Camera" singular.

I placed in my page this loop but nothing shows up. Not even the the text in the anchor tag. if I change the name of the post type to the singular label the browser doesn't render also the code after the loop (div "servizi")

<section class="small">
<h2>Le Nostre Camere</h2>
<div class="intro">
<?php echo do_shortcode('[pods field="intro_camere"]'); ?> 
</div>
<div class="lista_camere">
    <div class="lista_camere_item">
        <?php
            $args = array(
                'post_type' => 'Camere',
                'posts_per_page' => 3
            );
            $camere = new WP_Query( $args ); 

        if ( $camere->have_posts() ) : 

        while ( $camere->have_posts() ) : $camere->the_post(); ?>
            <div class="thumb">
                <?php the_thumbnail(); ?>
                </div>
                <h3><?php the_title(); ?></h3>
                <?php the_excerpt(); ?>
                <a href="<?php the_permalink(); ?>" class="button">Scopri di più</a>

            <?php endwhile; ?>

            <?php wp_reset_postdata(); ?>

            <?php endif; ?>
    </div>
</div>
<div class="servizi">
    <h2>Servizi</h2>
    <div class="lista_servizi">
    <?php echo pods_field_display( 'servizio' ); ?>
    </div>
</div>

I can't find what's wrong and my brain is melting lol

Upvotes: 0

Views: 221

Answers (0)

Related Questions