Custom Posts gone after using Custom Fields

I’m using Custom Post Types to create posts for my page, the posts are of the type “piso” (that is a flat in Spanish) so I created this WP_Query to display the posts:

                            <?php

                                $args = array(
                                        "post_type" => "piso"
                                );
                                $the_query = new WP_Query( $args );

                            ?>

                            <?php if( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>

                                <li class="artiq-slidder-item">

                                    <?php the_post_thumbnail(); ?>

                                     <a href="<?php the_permalink(); ?>">
                                        <p> <?php the_title(); ?> </p>
                                      </a>

                                </li>

                            <?php endwhile; endif; ?>

It was working perfectly fine and I could see on my page the thumbnails of the added posts and the titles.

Then I need to add certain classes to each posts so I created some custom fields to do so, I simply created a few but did nothing else. Now my posts are gone, I have deleted the custom fields, deleted all the posts and made them again but they don’t work anymore. I’m at a loss here.

Read more here: Custom Posts gone after using Custom Fields

Leave a Reply

Your email address will not be published. Required fields are marked *