wordpress - Issue with PHP loop not displaying all elements -


the following code snippet wordpress page reason not displaying of elements in loop. displaying 1 of 3 returned $latest_comment. when console out $latest_comment 3 obj, of want run through , display.

everything looks fine me i'm looking tired eyes. appreciated. seems must in if statement following $latest_comment assignment.

<?php $num_comment=get_comments_number();                             if($num_comment > 0){ ?>                             <div class="item-title">                             <?php $args = array(                                 'number' => 10000,                                 'post_id' => $post->id,                                 'status' => 'approve'                             );?>                             <?php $latest_comment = get_comments($args);                             //returns 3 obj correct                               if( $latest_comment ) foreach( $latest_comment $comment ) {                                   $vote = get_comment_meta( $comment->comment_id, 'age1', true );                                 //var_dump($vote);                                 if($vote=="on"){                                 ?>                              <div class="item-b-l">                                 .....html stuff here....                             </div>                              <?php  break; } ?>                             <?php } ?>                           </div>                         <?php } ?> 

remove <?php break; } ?> form code


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -