Skip Navigation

[Resolved] Customizing Number of logos to show from field.

This thread is resolved. Here is a description of the problem and solution.

Problem:
Customizing Number of logos to show from field. How to display the first three instances of a repeating field.

Solution:
you can use the "index" attribute to output the specific index of your repeating field.

You can find the proposed solution, in this case, with the following reply;
=> https://toolset.com/forums/topic/customizing-number-of-logos-to-show-from-field/#post-1198512

Relevant Documentation:
https://toolset.com/documentation/customizing-sites-using-php/functions/#image

This support ticket is created 6 years, 1 month 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by jairM 6 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#1198329

I have a repeater field where the user can select x amount of logos. I only want to display a maximum of three of those logos on my archive page but on the detailed page I will list all of them like below.

[types field='brand-logos' title='%%TITLE%%' alt='%%ALT%%' size='full'][/types]

How do I customize the code to only display a maximum of three logos?

#1198512

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As you have repeating field - can you use index attribute to output the specific index of your field:

For example:

[types field='brand-logos' title='%%TITLE%%' alt='%%ALT%%' size='full' index="0"][/types]
[types field='brand-logos' title='%%TITLE%%' alt='%%ALT%%' size='full' index="1"][/types]
[types field='brand-logos' title='%%TITLE%%' alt='%%ALT%%' size='full' index="2"][/types]

More info:
=> https://toolset.com/documentation/customizing-sites-using-php/functions/#image

#1198853

My issue is resolved now. Thank you!