My posts where showing for a while but now they are gone from my page. I see no mistakes and there's no error messages in debug mode, I really don't know why wouldn't my posts show with this code, specially when it was working before. All I did was add the Advanced Custom Fields plugin, add a few fields, link them to my posts and save. Then my posts were gone. I have disabled and deleted the plugin, remade all my posts but nothing works.

                <div class="artiq-slidder">

                        <ul class="artiq-slidder-ul">


                                $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">

                                <img src="<?php the_post_thumbnail(); ?>">  

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

                            <?php endwhile; endif; ?>


  • 1
    Are the posts showing in the admin? Maybe you accidentally changed the post name along the way? The edit.php page in the admin will show the post type. e.g. http://example.com/wp-admin/edit.php?post_type=piso Also, in what template does this code appear? Would you edit your question and include the whole template? What is the page/post that you are looking at and what's the URL? Also, small correction to your code, it should be if ( $the_query->have_posts() ) : Commented May 9, 2017 at 20:29
  • This topic is duplicate of wordpress.stackexchange.com/questions/266404/… Commented May 10, 2017 at 7:17

1 Answer 1


please try this:

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

Thank you

  • 1
    Please edit your answer, and add an explanation: why could that solve the problem?
    – fuxia
    Commented May 16, 2017 at 12:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.