Hello,
I am trying to: create a view to retrieve the most recent ads in my directory-like site
Link to a page where the issue can be seen: hidden link
I expected to see: valid html codes - all div tags were supposed to be opened and closed properly
Instead, I got: invalid html codes - containing an orphaned </div> tag. See below:
-----------------------------------------
Loop Output Editor
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<div class="container wpv-loop js-wpv-loop">
<wpv-loop wrap="1" pad="true">
[wpv-item index=1]
<div class="row ">
<div class="col-sm-12">[wpv-post-body view_template="Loop item in Most Recent Partnership Ads"]</div>
</div>
[wpv-item index=pad]
<div class="col-sm-12"></div>
[wpv-item index=pad-last]
<div class="col-sm-12"></div>
</div> <----------------------------------------------------------<<<< orphaned
</wpv-loop>
</div>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
[/wpv-no-items-found]
[wpv-layout-end]
-----------------------------------------
The html codes above contain 11 divs. So one of them is orphaned. Can you please tell me how I can fix it? Which </div> to delete or where to add a <div> tag in the codes?
Thank you very much.
chris
If you create the Loop with the Loop Wizard, the HTML can be trusted.
Yes, it looks Odd.
But there is logic behind it:
<div class="container wpv-loop js-wpv-loop">//Start A
<wpv-loop wrap="1" pad="true">
[wpv-item index=1]
<div class="row ">//Open B
<div class="col-sm-12">[wpv-post-body view_template="Loop item in Most Recent Partnership Ads"]</div>
</div>//Close B
[wpv-item index=pad]
<div class="col-sm-12"></div>//Open and close C
[wpv-item index=pad-last]
<div class="col-sm-12"></div>//Open and close D
</div>//Close if odd numbers.
</wpv-loop>
</div>//End A
As long you insert the Loop with the wizard you can rest assured that this is correct.
Please see another related thread here:
https://toolset.com/forums/topic/loop-assistant-insterts-after-the-loop-but-no-corresponds/