I need to set a conditional like this:
[wpv-conditional if="( '[wpv-post-date]' eq '[today]' )"]
How can i set "today" correctly?
Thanks.
Hello,
You don't need to create the custom shortcode, you can use the WordPress built-in function date_i18n():
https://developer.wordpress.org/reference/functions/date_i18n/
For example:
1) Dashboard-> Toolset-> Settings-> Front-end Content
in section "Functions inside conditional evaluations", add the function name: date_i18n
2) Setup the [wpv-conditional] shortcode, like this:
[wpv-conditional if=" ('[wpv-post-date format="Y-m-d"]' eq date_i18n('Y-m-d') )"]
Here display something ...
[/wpv-conditional]
More help:
Using custom functions in conditions
https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/using-custom-functions-in-conditions/
Thanks Luo!
When i access toolset setting page to add date_i18n, return: There has been a critical error on your website. Please check your site admin email inbox for instructions (attached image).
I have all plugins and core updated.
Any ideia?
I have tried it in my localhost, it works fine.
Please check these in your website:
1) It seems there are some PHP errors in your website, please share the PHP debug logs:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/
2) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2020, deactivate all custom PHP/JS code snippets, and test again
3) If the problem still persists, please provide database dump file(ZIP file) of your website, also point out the problem page URL, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/