Hi, I need a hint. Look at hidden link there you can see my custom posts excerpts.
The character string below:
"Cena: [34900 PLN]
Moc silnika: [204 KM]
Pojemność: [3 l diesel]"
I put manually in the excerpt of every post added. The characters in [ ] brackets are variables retrived from each post.
My problem is that after each post submission I need to add the code to the excerpt of each post manually. How to make it done automatically? I can't use the more tag or any known plugin because neither the first paragraph nor the fixed characters number matches what is shown in the excerpt although the data I want to show are inside the post (and they are taken from there).
You can not get data automatically without having a very specific place where you can grab it.
If that data is stored in Custom Fields (as example single Lines) you could add them to the content with the Toolset ShortCode for the Custom Fields, but that will not work in Excerpts as those do not support ShortCodes at all, unless you joggle with Custom Code:
https://wordpress.org/support/topic/how-to-execute-shortcode-in-excerpt-fields/
What I suggest is:
1. Store the variable Data in a (or several) custom fields
2. Use a WYSIWYG Custom Field to display what you usually display in the Excerpt and insert the Toolset ShortCodes there.
3. Call this WYSIWYG Field anywhere you need it with the Toolset ShortCode for this Field.
Please let me know if you need more help with this.
What you proposed works perfectly as it is, of course. The thing is that I tried to display that custom data in an Elementor's widget which calls exclusively for the excerpt. So in a single post I still need to manually put the data in the manual excerpt field.
I wonder if there's any chance to get it to work as I wish...
By the way the tollset shortcodes for the custom fields did work with the excerpt field.
Anyway, great thanks for your help again.
Excerpts do not execute ShortCodes unless you use Custom Code.
https://wordpress.org/support/topic/how-to-execute-shortcode-in-excerpt-fields/
So maybe you added already something that makes ShortCodes executable in Excerpts?
Anyway, ShortCodes are the only way to get that Data dynamically.
So, you need to store that data in ShortCodes or use Custom Code to get it, which I can not assist, I am afraid.
Thank you
Thanks a lot for your help.