|
Warning: field slug is already being used!
Started by: Javier Félix Hernández Márquez
in: Types Community Support
Quick solution available
|
|
2 |
3 |
7 years, 4 months ago
Javier Félix Hernández Márquez
|
|
What format has Toolset Date Field?
Started by: daveM
in: Types Community Support
Quick solution available
Problem:
I have a Custom Query where I check against a Toolset Date Field in a WP_Query.
Example:
$today = date( 'Y-m-d', strtotime('today') );
'meta_query' => array(
array(
'key' => 'wpcf-tour-date',
'value' => $today,
'compare' => '>=',
'type' => 'DATE',
),
),
It does not return anythign, even if there are fields with values.
What's wrong?
Solution:
Our Dates Field is a Timestamp.
As such, it's a numeric value, not a date format.
The 'type' DATE works with the 'compare' value BETWEEN only if the date is stored at the format YYYY-MM-DD and tested with this format.
And our Date Field is not storing it in this format but in a simple timestamp format.
The easiest solution is to compare as a NUMERIC value as that is what Toolset stores for the Date Fields.
Relevant Documentation:
https://toolset.com/forums/topic/filter-only-future-posts-in-wp_query-by-custom-date-field/#post-547754
|
|
2 |
3 |
7 years, 4 months ago
daveM
|
|
Field disapear
Started by: leonD-4
in: Types Community Support
Quick solution available
|
|
2 |
9 |
7 years, 4 months ago
Noman
|
|
How to change alt text?
Started by: Anonymous
in: Types Community Support
Quick solution available
Problem:
How to change alt text for custom image field?
Solution:
For the alt and title attributes, you can use placeholders to output the values of standard image fields added in WordPress: %%TITLE%%, %%ALT%%, %%CAPTION %%, and %%DESCRIPTION%%.
- For example, dynamic alt text fetched from media library like this:
[types field='horizon-residences-banner' alt='%%ALT%%'][/types]
- OR static alt text added directly to the image field like this:
[types field='horizon-residences-banner' alt='your alt text goes here'][/types]
Relevant Documentation:
https://toolset.com/documentation/customizing-sites-using-php/functions/#image
|
|
2 |
8 |
7 years, 4 months ago
Noman
|