Skip Navigation

[Resolved] Not related slider shortcodes with Custom Post Types

This support ticket is created 6 years, 9 months 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 9 replies, has 2 voices.

Last updated by Luo Yang 6 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#544097
error.png

Hi, I'm having a rather strange problem. I have generated several sliders that I call through a shortcode from a cpt called "products". The problem is that in some cases the linkage is not generated. But in others, yes. I thought it might be a cache problem, but I do not have any cache plugins installed. Probe creating new "products" but does not work either. Attached image of one of the cases (the names are marked in orange). Thank you very much!

#544111

Dear Mario,

I can see you are storing Views shortcode [wpv-view ...] into custom field "Slider Productos relacionados", how and where do you display the custom single line field "slider Productos relacionados"?
With Type's shortcode [types ....]?

I suggest you store the views slug "pr-papeleria-parafinas" into the single line field "slider Productos relacionados", and display the slider with Views shortcode, for example:
[wpv-view name="[wpv-post-field name='pr-papeleria-parafinas']"]

#544119
error2.png

Hi Luo!

I use it through a content template, because I need it displayed in a layout and change the result according to each product. Attached image of how I am using it. How could I apply the change you suggest in this scenario? Thank you!

#544141

As I mentioned above, you can try this:
1) In the single line field "slider Productos relacionados", you can store value as the View's slug "pr-papeleria-parafinas"

2) In the content template, display the Views shortcode as below:
[wpv-view name="[types field='slider-productos-relacionados'][/types]"]

It is very simple, you just need to replace attribute "name" as Types shortcode, please let me know if you need more assistance for it.

#544149

Luo,
I tried it but it still does not work ;/
Maybe it's because I change the slug of views?
I do not know what else to try

Thanks

#544152

Please provide a test site with same problem, and fill below private detail box with login details, also point out the problem page URL and content template URL, I can setup a demo for you.

#544531

Thanks for the details, here is what I found in your website:
1) Edit the product post "Estuche sin Ventana 1-ok"
hidden link
in meta box "Slider 3D", fill value: monge-estuches-sin-ventana
There isn't double quotes in it

2) Edit the view "Slider Monge Estuches Sin Ventana"
hidden link
in section "Elemento de bucle en Slider Monge Estuches Sin Ventana", add one line:
[wpv-post-title]

Since the custom image field "monge" is empty, it does not output anything, so you will not see the slider in front-end, for debug purpose, I added the post title to test

3) Test it in front-end:
hidden link
I can see the slider does display in section "Todos los modelos"

#544539
pic 2.jpg
pic 1.jpg

Dear Luo,

The problem is not a specific product ("estuche sin ventana"), the problem is that the linkage is not generated (pic 1).

There you can see the correct operation, I do not need the title, I need the images-> hidden link

I designed this layout so you can see that the views have content, the problem is that NO LINKAGE IS GENERATED hidden link (pic 2)

And it is not that nothing is shown because there are no images. Since in that case it should show the label "No items found".

Right now I have modified all the products, and there is at least one product per view, and the link is still not generated.

I hope you understand, or ask me for more details, I need to solve it as soon as possible.

Thanks!

#544550

Luo, I would need to resolve this as soon as possible. It seems that what does not work is the linking through shortcodes, but if I show the slider through view cells in the layouts maybe it works, as in the previous example.

The difficulty is that I would need the layouts to be assigned by subcategory (linea platos, manteles individuales etc.) to each product, but I can not make that automatic, but it must be done for each product. Is there any way to make it automatic? Child layouts?

#544557

Again, please check the steps I mentioned above:
https://toolset.com/forums/topic/not-related-slider-shortcodes-with-custom-post-types/#post-544531

1) There isn't double quotes in the custom field value
For example the product "EC-5":
hidden link

The meta boxes: "Slider 3D", you just need to fill value as the view's slug: monge-postres, there isn't double quotes

2) Then test it in the front-end:
hidden link

I can see both sliders are working

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