Im trying to create a slider for images used within a post.
I have a custom post type called 'packages' and a custom field for images within this post type.
After adding images I've created a 'view' to display the results as a slider inside the post in which the images relate.
The problem i have is that the view is displaying all the images in my custom post type within the post and not just the ones associated with that post.
Its also not separating the images into separate slides but displaying 1 slide with all attached images per post, then sliding to the next posts images.
There must be a way of filtering the images to only show ones assigned to the current post being viewed, however the query filter option only allows selection by 'post id' and i have to input that as a number, but this means i cannot use it within a layout and automatically change the id using a wpb-post-id shortcake as it doesn't allow shortcodes
I hope your Image Field is not a repeatable Field.
Because if so, you will need a Custom Code solution, that we do not provide as such, since it's not the purpose of Repeatable Image fields to create Sliders with.
But there are some customized solutions for this, using FlexSlider:
https://toolset.com/forums/topic/flexslider-tutorial-or-example-please/#post-99976
https://toolset.com/forums/topic/is-it-possible-to-have-slide-images-within-posts-type/#post-253251
The part of returning only the Fields of the Post where this View is used on, is in both cases the same and relatively simple.
You can as example set the View to Query Posts with ID set by the ShortCode attribute "ids"
Then you insert the View in your Post, and in the View ShortCode, you pass the Post Id with our [wpv-post-id] ShortCode.
I added a ScreenShot and below is the example View integration Code on how to use that.
[wpv-view name="your-view" ids="[wpv-post-id]"]
That Post, where the View is used on, will now display only the currently viewed Post in the View, and subsequently, if you call Post fields, only those fields.
Please do not hesitate to open a new thread if other issues or problems arise
Thank you for your patience.