Skip Navigation

[Gelöst] Ad in loop only one time

This support ticket is created vor 5 Jahren, 1 Monat. 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.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Dieses Thema enthält 1 Antwort, hat 2 Stimmen.

Zuletzt aktualisiert von Nigel vor 5 Jahren, 1 Monat.

Assistiert von: Nigel.

Author
Artikel
#1372275

Hi,
We want to have just one Ad after 3rd item in Loop. We've tried with loop index 1/2/other and pad but we can not find a solution. We want the Ad just one time and not after 3 result, Just after the 3rd element.

Thanks so much and have a nice day!

#1372343

Nigel
Supporter

Sprachen: Englisch (English ) Spanisch (Español )

Zeitzone: Europe/London (GMT+00:00)

This will work if the output format of your View is a simple list:

	<!-- wpv-loop-start -->
	<wpv-loop>
      [wpv-item index=3]
		[wpv-post-body view_template="loop-item-in-list-things"]
      	<p>SOME AD GOES HERE</p>
      [wpv-item index=other]
		[wpv-post-body view_template="loop-item-in-list-things"]
	</wpv-loop>
	<!-- wpv-loop-end -->

Note that the wrap attribute is not included on the wpv-loop tag.

More complex View output formats, such as grids, require the wrap attribute and the pad entries, but in that case the index number is treated as "nth" instead of "n".

So in my example above, the section with index=3 is only output once, for the 3rd iteration of the loop.

If the wrap attribute were included on the wpv-loop tag then it would be output every 3rd iteration.