Navigation überspringen

[Gelöst] Modify the WP Query with a Custom Field Post ID

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

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 vor 4 Jahre, 2 Monaten. 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 -

Zeitzone des Unterstützers: Asia/Kolkata (GMT+05:30)

Dieses Thema enthält 19 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von kristofG vor 4 Jahre, 1 Monat.

Assistiert von: Minesh.

Author
Artikel
#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
Unterstützer

Sprachen: Englisch (English )

Zeitzone: Asia/Kolkata (GMT+05:30)

Can you please check now: versteckter Link

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

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
Unterstützer

Sprachen: Englisch (English )

Zeitzone: 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!