Skip Navigation

[Résolu] Slider from image Post field – Loop showing all images from all Custom Post Type

This support ticket is created Il y a 7 années et 8 mois. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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+01:00)

Marqué : 

This topic contains 3 réponses, has 2 voix.

Last updated by Cesar Il y a 7 années et 8 mois.

Assisted by: Nigel.

Auteur
Publications
#421814

I am trying to create an Slider from the images uploaded as a Custom Post Fields (Type image)

I managed to use bootstrap featured to solve my needs in terms of "slidered" features.

My problem is that the loop from my View is displaying every image that use the Post Field, so I end up having a slider with all the images related to my Custom Post Type in a Single view.

I'm rally frustrated...

This is my code for my loop

	<wpv-loop>
          [wpv-post-body view_template="loop-item-in-img-slider-de-la-exposicion"]
	</wpv-loop>

This is my code for the template

[wpv-for-each field="wpcf-img-expo"]
    <div class="item">
			[types field="img-expo"][/types]
    </div>
[/wpv-for-each]

I did follow every support post I found but they are pretty old, please I need some fresh ideas.

Thanks!

#421874

Nigel
Supporter

Languages: Anglais (English ) Espagnol (Español )

Timezone: Europe/London (GMT+01:00)

I'm not sure what kind of view you are creating.

The wpv-for-each shortcode you have set up looks correct.

I ran a simple test with a custom field 'images' added to my CPT and created a content template for displaying a single post of that CPT and added the following to the template:

<ul>
[wpv-for-each field="wpcf-images"]
  <li>[types field="images"][/types]</li>
[/wpv-for-each]
</ul>

That showed each of the images attached to the current post I was viewing, but it didn't show images from any other post.

In my example I am only looking at one post at a time, and looping through the images attached to that post.

I suspect you have set up a view which is looping through all of your posts of the CPT, and then in the content template you are outputting all of the images for each post, hence you end up with all the images of all the posts.

Depending on what you are trying to achieve where, you may not need a view, you may just need a content template.

#421893

So the problem was that I did use the loop (witch is for archive not for single_post Custom_post_field)

I will did migrate wpv-for-each method to a Content Template

I think that it would be nice to have one of those great tutorials you have related to this topic. I'm not the only one trying to achieve this.

It should be easier to found a work around about how to create sliders and galleries from Image's Post Fields

Thanks for you support, you really point me to the right direction 😉

#421905

I did post my solution in another post replying to a user with a similar problem

https://toolset.com/forums/topic/unable-to-create-a-simple-slider-from-a-repeating-field/#post-421904

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