[Resuelto] How to create slider from repeating field in a CPT & display in a Content Layout
This support ticket is created hace 7 años, 6 meses. 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.
I have a CPT (Care Homes) which has a repeating image field in it.
I wish to display the images from the repeating field in a slider which is embedded in a Content Template. The Content Template will be used on various pages and should display the Slider and other fields from the CPT.
I have looked at lots of 'solutions' in the Support Forum, but none have worked for me.
My scenario is this:-
I have created a View which loads the CPT (Care Homes) with a Query Filter "Include only posts with IDs set by the View shortcode attribute "ids" eg. [wpv-view name="view-name" ids="1"]
I then edited the Content Template for the auto generated "Care Homes - Slide" to have the following code:-
Hello. Thank you for contacting the Toolset support.
I need to check on your install, why it's not working but before you share temporary access details with me:
1)
Could you please try to resolve your issue by deactivating all third-party plugins as well as the default theme to check for any possible conflicts with any of the plugins or themes?
2)
If #1 does not help:
Please share problem URL where I can see slider you added not working.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).
I have set the next reply to private which means only you and I have access to it.
You added this shortcode to page's content template and at this point when you use [wpv-post-id], it will return you the page ID where you've added the view's shortcode using content template.
Thanks for that info. Yes, I tried adding in the actual ID as you have done (I have seen these tutorials and they are very helpful), but I would have to add the individual CPT ID on each page I wanted the slider displayed on.
Whilst this is not a major issue for me, I was hoping to programmatically add the CPT ID based on the page which is currently loaded. That way I can just use the shortcode in the Content Template and any new pages created with that Content Template would automatically show the correct slider.
I guess this is the tricky part, trying to pull the correct CPT since the page doesn't know which one to use unless you put in the actual ID like you have done.
I realise that I may have to change the way I do things, I just hoped there might be a way to do it automatically.
Well - as you may know posts, pages, cps etc..etc.. is post for wordpress and if you are on page [wpv-post-id] will return page id, if you are on single post [wpv-post-id] return post id.
But I wonder why you create a page with the same title for the posts you are created.
If you want to display the post content you can create a content template or single layout for that post type.