I mean..every product has only 1 producer, that’s why I didn’t understand it just print 3 times the same name.
Hello Jory,
I didn’t understand, I mean: I did a relation from a product to a producer (1 product as just 1 producer).
And it’s running well…there is just a producer’s problem. I can’t just tell to stop after 1 iteration?
thanks
Hello @smipweb
I’ll need to see more code and have more info to better understand what you did.
Please share your full templates and other code you are using to create the view.
Cheers, Jory
Ok, what can I show you?
Because the code…it’s just the shortcode I put.
Than, we added the relation for the product with the producer (by extending the post type with pods) and we do a custom taxonomy to create the producer
Please share the following:
– The full shortcode (latest version)
– Where you are inserting this shortcode (where exactly, not just the page type but the actual location, eg. a field, a block, a textarea)
– The Pod template (if used)
– The link to the page so I can see the output.
That’s an exemple:
https://terranostra.ch/product/uva-nera-senza-semi/
The shortcode is after INFO PRODUTTORE: the producer listed 3 times is “DA CRI – Frutta..”.
The code:
[pods field="producer"] <b>{@producer_name}</b>
{@producer_squared_logo}<br/><br/>
{@producer_description_short} <span id="dots"></span>
<span id="more" style="display: none;">{@producer_description_long}</span>
<br/><br/>
<button onclick="myFunction()" id="myBtn">Leggi di più</button>
<br/><br/><b>Indirizzo :</b> <a href="https://www.google.com/maps/place/{@producer_address}" target="_blank" >{@producer_address}</a><br/>
<b>Sito web:</b> {@producer_website}
<br/> {@producer_gallery}<br/>
{@producer_personal_photo}
[/pods]
Do you need something else?
thank you!!!
Hi @smipweb
First off, I think it’s best to wrap this code in a <div> element or something, this reads a lot easier :).
Anyhow, from what I can see it all should be fine.
Could you try to add use_current=1
to the shortcode?
[pods use_current=1 field="producer"]
It could be that in this context (because of the use of Elementor) Pods isn’t aware of the current object.
Cheers, Jory
thank you Jory,
I tried but nothing (tried also with “”).
others suggestions?
Hi @smipweb
Could you add the post ID in the template so I can check the value?
Just place <!--{@ID}-->
at the beginning so it’s hidden in the page code.
Cheers, Jory
Hello,
this is the page:https://terranostra.ch/product/aglio-secco/
or I didn’t understand what do you mean..
Hi @smipweb
I don’t think you understood. I wanted to make sure these 3 items are actual different items within WordPress because the content is exactly the same. Therefor if you add the object ID in the template you can simply see whether it is the same or not.
In any case, the shortcode is correct, that isn’t your problem as far as I can tell.
Could you try the code below?
[pods field="producer"]
<div id="producer-{@ID}">
<b>{@producer_name}</b>
{@producer_squared_logo}<br/><br/>
{@producer_description_short} <span id="dots"></span>
<span id="more" style="display: none;">{@producer_description_long}</span>
<br/><br/>
<button onclick="myFunction()" id="myBtn">Leggi di più</button>
<br/><br/><b>Indirizzo :</b> <a href="https://www.google.com/maps/place/{@producer_address}" target="_blank" rel="noopener">{@producer_address}</a><br/>
<b>Sito web:</b> {@producer_website}
<br/> {@producer_gallery}<br/>
{@producer_personal_photo}
</div>
[/pods]
Ah,ok,i see,but the ID is always the same…you can check 🙁
Then you have some other issue, it looks like this post is simply added three times, could that be correct?
Maybe enable “custom fields” (WordPress core metabox) and check if you can see such issues within the metadata.
Custom Fields
Also please check for plugin conflicts:
https://docs.pods.io/faqs/plugin-theme-conflicts/
Cheers, Jory