Sorry for my bad English. That’s why it’s not so easy to understand my issues.
Now I added define('PODS_SHORTCODE_ALLOW_SUB_SHORTCODES',true);
to my wp-config.php.
Basically I want match the ID of the current post to show the fields of the custom-fields of the current post.
Example:
Pod: members
custom-fields: phone (field-type: Phone), downloads (field-type: File / Image / Video)
Entries:
id=1, post_title: Tarzan, post_content: King of the jungle, phone: 999-111, downloads: tarzan.pdf
id=2, post_title: Simba, post_content: Lion King, phone: 999-222, downloads: simba1.pdf, simba2.pdf
id=3, post_title: Arielle, post_content: The little mermaid, phone: 999-333, downloads: arielle.pdf
To display also the custom fields without modifying the wordpress-theme, I add this code into post_content of Tarzan:
[pods name="members" template="my_template"]
template: my_template:
<ul>
<li>Phone: {@phone}</li>
<li>Downloads: {@downloads}</li>
</ul>
Now I look at domain.com/members/Tarzan:
The result is:
Tarzan
King of the jungle
Phone: 999-111
Downloads: https://domain.com/wp-content/uploads/2019/12/tarzan.pdf
Phone: 999-222
Downloads: https://domain.com/wp-content/uploads/2019/12/simba1.pdf https://domain.com/wp-content/uploads/2019/12/simba2.pdf
Phone: 999-333
Downloads: https://domain.com/wp-content/uploads/2019/12/arielle.pdf
Unfortunately not the result I want. I want:
Tarzan
King of the jungle
Phone: 999-111
Downloads: https://domain.com/wp-content/uploads/2019/12/tarzan.pdf
So I tried the following pods-code:
[pods name="members" template="my_template" where="id={@id}"]
and
[pods name="members" template="my_template" slug="{@id}"]
The result is:
Tarzan
King of the jungle
Okay, the code doesn’t work.
That’s why I added define('PODS_SHORTCODE_ALLOW_SUB_SHORTCODES',true);
to my wp-config.php.
Now I wrote:
[pods name="members" template="my_template" where="id={@id}" shortcodes=1]
and
[pods name="members" template="my_template" slug="{@id}" shortcodes=1]
The result is:
Tarzan
King of the jungle
Okay, obviously {@id} inside the [pods …] doesn’t work.
Now I am at a loss.
Thanks for your help.
Best regards, Reflexa