-
AuthorPosts
-
January 25, 2024 at 5:14 pm #1432045
I’m working on adding the metadata element to a bunch of old blog articles and I’m wondering if it’s possible to set defaults for this element? For example, each time I use it I have to change the default separator from “/” to “|”
Thanks!
January 26, 2024 at 2:05 am #1432081Hi goldengate415,
There’s no hook/filter to modify the default separator in Post Metadata, so the only option is to override the Post Metadata element via child theme, then do the following:
1. Go to wp-content\themes\enfold\config-templatebuilder\avia-shortcodes folder, then copy the post_metadata folder.
2. Go to the child theme and create a new folder shortcodes then paste the post_metadata folder, and edit post_metadata.php
3. Find this code (line 630 in the latest version)$default = array( 'post_selected' => '', 'seperator' => '/', 'before_meta_content' => '', 'after_meta_content' => '', 'margin' => '', 'padding' => '', 'align' => 'left', 'custom_title' => '', 'size' => '', );
Just change the separator value.
Hope this helps.Best regards,
NikkoJanuary 26, 2024 at 4:13 pm #1432155Thank you for the response, Nikko!
Feature request for Gunter: possible one day to make this element (or all elements actually…) remember the last used settings?
Also the element needs a minor spelling correction… “separator” is spelled “seperator”
Thanks much and ok to close this thread.
Best,
RobJanuary 28, 2024 at 7:58 am #1432255Also, I decided it was easier to save templates of the metadata element… each template I saved has a different default setting so I don’t have to keep changing the settings each time I use the element.
January 28, 2024 at 8:20 am #1432256Hi,
Better way would be to use custom elements which are editable – https://kriesi.at/documentation/enfold/custom-element-templates/.
But I will think about a filter that will allow to change the default settings.
Best regards,
GünterJanuary 28, 2024 at 4:41 pm #1432268Günter,
Great to see your post and thank you! After 7 years using Enfold I had never used the custom element and have been using templates instead… wow, this is great! I will start using them for buttons, etc. Wonderful!However in the case of the custom element for post metadata, it appears when customizing on the content tab then gonig to the “edit metadata element” and the first box “Metadata” which says “Select the metadata you want to display, if empty or not available your selection will be skipped. On the regular (non customized element) this opens a dropdown with “add/edit metadata” and a “+” so you can stack the metadata elements like “author” and “publishing date”.
However with the custom element for post metadata, this same field is just a dropdown without the “+” so it lets you select only one element such as “Last Modified Date” but there is no way to string them together (that I can see) like there is on the original non-custom element.
Am I doing something wrong?
Thanks,
RobJanuary 28, 2024 at 5:17 pm #1432274Hi,
Please read chapter https://kriesi.at/documentation/enfold/custom-element-templates/#custom-elements-advanced-options and use
add_theme_support( 'show_advanced_custom_element_options' );
This will enable more options.
And also further down https://kriesi.at/documentation/enfold/custom-element-templates/#custom-elements-advanced-option-custom-elements-for-subitems
Best regards,
GünterJanuary 28, 2024 at 6:09 pm #1432285Thanks Günter!
January 29, 2024 at 3:16 pm #1432396Hi,
You must change the following options:
Hierarchical Custom Elements: Allow use of hierarchical custom elements
Custom Elements For Subitems: Individually select subitem custom element templatesThen you can add the meta elements in custom template and lock them if you like.
Best regards,
GünterJanuary 29, 2024 at 4:26 pm #1432406Hi Günter,
That worked beautifully!!!Thank you!!!
I hope this thread helps others with this. The use of a #customelement in ALB will be a huge time saver for me. I didn’t know it was even an option!
Best,
Rob#ALB #customelement
January 29, 2024 at 4:26 pm #1432407Hi,
For next release 5.6.11 I also added a filter:
Best regards,
GünterJanuary 29, 2024 at 4:30 pm #1432408Thank you! Just anotehr reason why I have been loyal to Enfold all these years. The ultimate theme!
January 30, 2024 at 6:22 am #1432446Hi,
Thank you for the update.
The Separator/Whitespace element is spelled correctly on our end. Please check the screenshot in the private field. Would you mind providing a screenshot of the text or element?
Best regards,
IsmaelJanuary 30, 2024 at 8:06 am #1432456Hi Ismael!
It’s not the Separator/Whitespace element I’m speaking about, it’s the Post Metadata element. If you open that element you’ll see it spelled “Seperator”“Seperator
Will be used to seperate multiple metadata”Let me know if you want a screenshot. You guys are great for caring about this little minor misspelling! The new custom element has saved me hours of work today, thanks again! ;)
Best
RobJanuary 30, 2024 at 8:29 am #1432460Hi Rob,
I did already a replace of wrong spelled “Separator” for Enfold 6.0 (coming soon) – but only in UI. Making changes to id’s or class names is too dangerous to break existing sites.
Thanks for pointing at this.And thank you for staying to Enfold.
Best regards,
GünterJanuary 30, 2024 at 3:58 pm #1432505Enfold 6.0! Exciting! I can remember being excited about version 4.0!
Best,
RobJanuary 31, 2024 at 7:14 am #1432558 -
AuthorPosts
- The topic ‘Metadata element – possible to add default settings?’ is closed to new replies.