Skip Navigation

[Resolved] Duplicate fields appearing for no apparent reason in loop 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.

This topic contains 1 reply, has 2 voices.

Last updated by Beda 6 years, 4 months ago.

Author
Posts
#1079821

I have the following which seems to be producing the loop successfully at least the general structure, however for some reason the list of custom fields and taxonomies are appearing multiple times right after each other, 2 or sometimes 3 times even. There is no rhyme or reason to why this would happen. The posts all have the same fields filled out and were added exactly the same way. The [wpv-post-body] appears just once, but the fields show 2-3x times right in a row.

What gives? Any idea why this is happening?

LOOP:
<wpv-loop>
<div class="row post-listings-container">
<div class="col-sm-6 post-listing-content">
<h3 class="h-custom-headline man h3 ancillary-search-listing-h3">[wpv-post-title]</h3>
<div class="x-text ancillary-search-listing-text">
[wpv-post-body]
<span>Insurance: [types field="insurance"][/types]</span><br>
<span>Sales Portal: [types field="sales-portal"][/types]</span><br>
<span>Commission: [types field="commission"][/types]</span><br>
<span>Pay Cycle: [types field="pay-cycle"][/types]</span><br>
<span>States Excluded: [types field="states-excluded"][/types]</span><br>
<span>Specialties: [wpv-post-taxonomy type="specialty"]</span><br>
<span>Categories: [wpv-post-taxonomy type="ancillary-type"]</span>
</div>
</div>
<div class="col-sm-3 post-listing-cta ancillary-listings-columns align-middle">content here</div>
<div class="col-sm-3 post-listing-cta ancillary-listings-columns align-middle">content here</div>
</div>
</wpv-loop>

HTML loop item output:

<div class="row post-listings-container">
<div class="col-sm-6 post-listing-content">
<h3 class="h-custom-headline man h3 ancillary-search-listing-h3">[wpv-post-title]</h3>
<div class="x-text ancillary-search-listing-text">
[wpv-post-body]
<span>Insurance: [types field="insurance"][/types]</span><br>
<span>Sales Portal: [types field="sales-portal"][/types]</span><br>
<span>Commission: [types field="commission"][/types]</span><br>
<span>Pay Cycle: [types field="pay-cycle"][/types]</span><br>
<span>States Excluded: [types field="states-excluded"][/types]</span><br>
<span>Specialties: [wpv-post-taxonomy type="specialty"]</span><br>
<span>Categories: [wpv-post-taxonomy type="ancillary-type"]</span>
<span>Insurance: [types field="insurance"][/types]</span><br>
<span>Sales Portal: [types field="sales-portal"][/types]</span><br>
<span>Commission: [types field="commission"][/types]</span><br>
<span>Pay Cycle: [types field="pay-cycle"][/types]</span><br>
<span>States Excluded: [types field="states-excluded"][/types]</span><br>
<span>Specialties: [wpv-post-taxonomy type="specialty"]</span><br>
<span>Categories: [wpv-post-taxonomy type="ancillary-type"]</span>
</div>
</div>

#1080209

I'm confused, there are 2 codes you share.
One is the Loop editor, and the other? What you see in the front end? But that would mean it's broken, as the ShortCodes must be expanded at that moment - or at least triplicated, as you state it does.

However, to solve any such issue please do this:
- head to the View, where you create this
- Delete the "Loop Editor" HTML content and keep only this:

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
		<wpv-loop>
		</wpv-loop>
	<!-- 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]

- Use the Wizard to insert a field that right now shows 3 times

Test this on the front end.

If it's solved, please proceed by inserting this WITHIN the <wpv-loop>HERE</wpv-loop> tags:

<span>Insurance: [types field="insurance"][/types]</span><br>
<span>Sales Portal: [types field="sales-portal"][/types]</span><br>
<span>Commission: [types field="commission"][/types]</span><br>
<span>Pay Cycle: [types field="pay-cycle"][/types]</span><br>
<span>States Excluded: [types field="states-excluded"][/types]</span><br>
<span>Specialties: [wpv-post-taxonomy type="specialty"]</span><br>
<span>Categories: [wpv-post-taxonomy type="ancillary-type"]</span>
<span>Insurance: [types field="insurance"][/types]</span><br>
<span>Sales Portal: [types field="sales-portal"][/types]</span><br>
<span>Commission: [types field="commission"][/types]</span><br>
<span>Pay Cycle: [types field="pay-cycle"][/types]</span><br>
<span>States Excluded: [types field="states-excluded"][/types]</span><br>
<span>Specialties: [wpv-post-taxonomy type="specialty"]</span><br>
<span>Categories: [wpv-post-taxonomy type="ancillary-type"]</span>

Does anything repeat?
Keep in mind that the taxonomy ShortCode as you use it will display all terms of that post.
However it should not output each field more than once each post (unless, of course, those are repeating fields...)

If that does not solve the issue, please try with no other plugins, a native WordPress theme, and as well with a fresh, new View.
It would then as well be interesting to know if you recall since when that happens.