In den letzten 30 Tagen erstellte Support-Threads: 0
This user has no favorite topics.
Forum Topics Created
|How to translate text in a view||2||6||vor 1 Monat, 1 Woche|
|Can't translate Repeatable Field Group with WPML Classic Translation Editor||3||11||vor 1 Monat, 1 Woche|
|How to get related posts with a dynamic parent post ID||2||4||vor 5 Monate, 2 Wochen|
How to access single fields from a CPT with relationship in php
The issue here is that the use wanted to display custom fields values from their Parent/Child Posts on the frontend
Solution: If it is a custom field value on a related item then you can use our [types field='my-field'][/types] shortcode with the item attribute.
See our documentation below on the item attribute. https://toolset.com/documentation/programmer-reference/views/views-shortcodes/item-attribute/
|2||5||vor 5 Monate, 2 Wochen|
|How to order per dates||2||3||vor 6 Monate|
|How to get dates into a dropdown with a given parent ID (product id)||3||10||vor 6 Monate|
|Possible to have different field group on WooCommerce Products based on category||2||3||vor 6 Monate|
|How to get value of a field from a custom post with parent post reference field||2||7||vor 6 Monate|
How to get product title in a view, with a given ID field from it’s relationship
I have a view, where I do show different part for a review. Now I like to add the product title and it's url with a given ID.
The Review custom post type and the products are in a relationship.
If it is one-to-many relationship between "Products" and "Review", you can display the parent "Products" post information with "item" attribute, for example:
|2||3||vor 6 Monate|
PHP Warning – disabled for security reasons
Problem: PHP Warning - disabled for security reasons
Warning: getcwd() has been disabled for security reasons in /mnt/disk1/home/chillicyclingksb/public_html/wp-content/plugins/types/vendor/toolset/toolset-common/lib/Twig/src/Loader/FilesystemLoader.php on line 34
Solution: Can you please check with your hosting/server authority if they have block such functions.
|2||3||vor 6 Monate, 1 Woche|
|How to filter dates in a view||2||7||vor 6 Monate, 1 Woche|
|How to show all dates, inclusive post title plus some fields||2||14||vor 7 Monate|
|How to translate select fields in a CRED post form||3||6||vor 7 Monate, 3 Wochen|
|How to show futures dates – each on one line?||2||3||vor 8 Monate, 3 Wochen|
How to get the values of a date field?
Problem: I would like to get the values of a repeating date custom field, and output a custom data structure including the formatted dates.
$post_id = 1234; $start_dates = get_post_meta($post_id, 'wpcf-start-tour-date', false);
Note that the Types field slug includes a wpcf- prefix here. This will return an array of date values in Unix timestamp format.
To get a single field value, like the number of tour nights, you can use get_post_meta again like so:
$number_of_tour_nights = get_post_meta($post_id, 'wpcf-number-of-tour-nights, true);
Once you have those values, you can loop over the repeating values and create your own array of information to output. You'll need a way to format dates based on Unix timestamps. You can use PHP's date function for this. For example, to format a date like 2021-08-31 from a Unix timestamp like 1630368000, you can use the date function like so:
$timestamp = 1630368000; $formatted_date = date('Y-m-d', $timestamp);
If you want to calculate a date in the future based on the start date and number of nights, you can use the number of seconds in a day (60 seconds per minute * 60 minutes per hour * 24 hours per day) in your PHP calculations, then format the end date:
$start_date = 1630368000; $number_of_nights = 4; $end_date = $start_date + (60 * 60 * 24 * $number_of_nights); $formatted_end_date = date( 'Y-m-d', $end_date);
|2||6||vor 10 Monate, 3 Wochen|