[wp-hackers] Two loops

hamlet hamlet11 at hotmail.es
Sun Nov 17 00:11:09 UTC 2013


Hello, I am the following issue:

I am using a custom post type (it has support for comments)
single-myPostType.php

         if ( have_posts() ) {
             while ( have_posts() ) {
                 the_post();

                 get_template_part('content', 'single-myCustomPostType');

                 comments_template('', true);
             }
         }
content-single-myCustomPostType.php

(...)
       $loop = wp_get_the_related(get_the_ID());
       if ($loop->have_posts())
         while ($loop->have_posts()) {
           $loop->the_post();
           get_template_part('content', 'related');
         }
(...)

It is getting comment forms if some related has this options enabled. 
Any idea?


More information about the wp-hackers mailing list