Skip Navigation

[Resolved] Orphaned tag in Loop Output Editor Output

This support ticket is created 6 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 1 reply, has 2 voices.

Last updated by Beda 6 years, 4 months ago.

Assisted by: Beda.

Author
Posts
#597296
view_html_bug.png

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

#597359

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/

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.