PlugIn ignores html structure at “foreach” loop
-
Hi, first thx for this great plugin!
Second, if I use “
comments_like_dislike($comment_id)
” inside a “foreach” loop, the “.cld-like-dislike-wrap” always jumps out of my html structure.Short example:
<?php $recent_comments = get_comments( array(
…
) );foreach ( $recent_comments as $comment ) : setup_postdata( $post ); ?>`
<?php
$comment_id = get_comment_ID();
echo ‘<div class=”bar”>
<div class=”like”>’. comments_like_dislike($comment_id) .'</div>
‘</div>’;
endforeach;?>`As result the “.cld-like-dislike-wrap” dont stay inside the “.bar > .like” structure, it just jumps out of it.
How it sholud be:
<div class="bar"> <div class="like"> <div class="cld-like-dislike-wrap cld-template-1"> .... </div> </div> </div>
How it does:
<div class="cld-like-dislike-wrap cld-template-1"> .... </div> <div class="bar"> <div class="like"> </div> </div>
How can I fix this?
Thx for any help.
- The topic ‘PlugIn ignores html structure at “foreach” loop’ is closed to new replies.