Passer la navigation

[Résolu] Modify the WP Query with a Custom Field Post ID

Ce fil est résolu. Voici une description du problème et la solution proposée.

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 Il y a 4 années et 2 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.

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 -

Fuseau horaire du supporter : Asia/Kolkata (GMT+05:30)

Ce sujet contient 19 réponses, a 2 voix.

Dernière mise à jour par kristofG Il y a 4 années et 1 mois.

Assisté par: Minesh.

Auteur
Publications
#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
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Can you please check now: lien caché

I've created the following content templates and added the view's within that related content templates:
=> lien caché
=> lien caché

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
Supporter

Les langues: Anglais (English )

Fuseau horaire: 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!