Saltar navegación

[Resuelto] Modify the WP Query with a Custom Field Post ID

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:
Modify the WP Query with a Custom Field Post ID - how to display nested shrotcode view with elementor

Solution:

You can find the proposed solution in this case with the following reply:
https://toolset.com/forums/topic/modify-the-wp-query-with-a-custom-field-post-id/page/2/#post-2037605

Relevant Documentation:

This support ticket is created hace 4 años, 2 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.

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 -

Zona horaria del colaborador: Asia/Kolkata (GMT+05:30)

Este tema contiene 19 respuestas, tiene 2 mensajes.

Última actualización por kristofG hace 4 años, 1 mes.

Asistido por: Minesh.

Autor
Mensajes
#2037121
Screenshot_2.png
Screenshot_1.png

Hi,
I tried that, but I get an overview of all Expertises (Pages) and CPT Cases followed by [/types]"]

#2037559

Minesh
Colaborador

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Can you please check now: enlace oculto

I've created the following content templates and added the view's within that related content templates:
=> enlace oculto
=> enlace oculto

And then added the content templates as given under within shortcode module:

[wpv-post-body view_template="ct-to-display-related-expertise"]
[wpv-post-body view_template="ct-to-display-related-cases"]

Can you please confirm now it works as expected.

#2037563

It works, but why? 🙂 The Content Templates are not assigned to any Post types or Taxonomies.

So why does [wpv-view name="related-case" related="[types field='related-case'][/types]"] in the Elementor Template not work, but when you place the same code in a Content Template and load the CT in Elementor, it works?

#2037605

Minesh
Colaborador

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Because Elementor's shortcode module does not able to parse the nested shortcode we added like:

[wpv-view name="related-expertise" related="[types field='related-expertise'][/types]"]

The workaround is that I shared is we created the content template that holds the view:

[wpv-view name="related-expertise" related="[types field='related-expertise'][/types]"]

And added the content template shortcode within the Elementor's shortcode module:

[wpv-post-body view_template="ct-to-display-related-expertise"]
[wpv-post-body view_template="ct-to-display-related-cases"]

As we are using content template as container that holds the view, its not required to set content template to display with any post type or taxonomy.

#2042147

Minesh has been EXTREMELY helpful. Thank you!