Pat
Support threads created in the last 30 days: 0
Favorite Forum Topics
This user has no favorite topics.
Forum Topics Created
Status | Topic | Supporter | Voices | Posts | Freshness |
---|---|---|---|---|---|
Conditional to determine current User’s horoscope sign
1
2
Started by: Pat
in: Toolset Professional Support
Problem: I would like to use a conditional to display different content based on the current User's horoscope sign, based on a User birthdate custom field. Solution: <wpv-loop> [wpv-view name="nested-view-slug" users="[wpv-current-user info='id']"] </wpv-loop> Add the following custom shortcode: add_shortcode( 'is_month_day_between', 'is_month_day_between_func'); function is_month_day_between_func($atts) { // shortcode attributes for timestamps start time, end time, and test time $start = $atts['start']; $end = $atts['end']; $test = $atts['test']; $result = 0; // make new timestamps using the current Year so we can compare $modStart = strtotime(date('d F, ', $start) . date('Y')); $modEnd = strtotime(date('d F, ', $end) . date('Y')); $modTest = strtotime(date('d F, ', $test) . date('Y')); // compare and return 0 or 1 if test is between start and end if(($modStart <= $modTest) && ($modTest <= $modEnd)){ $result = 1; } return $result; } Register 'is_month_day_between' in Toolset > Settings > 3rd party Shortcode Arguments, then you can use it in a conditional that tests the User's birthday against a known range of dates. [wpv-conditional if="([is_month_day_between start='1498247543' end='1440359543' test='[wpv-post-field name='wpcf-date-de-naissance']'] eq '1')"] This month and day is between start and end [/wpv-conditional] [wpv-conditional if="([is_month_day_between start='1498247543' end='1440359543' test='[wpv-post-field name='wpcf-yourdatefieldslug']'] eq '1')" evaluate="false"] This month and day is not between start and end [/wpv-conditional] To account for the first sign, which spans two years, you must use two conditionals that test if the date is between Dec 21 and Dec 31, or if the date is between Jan 1 and Jan 21. |
3 | 20 | 6 years, 10 months ago | ||
Cred commerce with price calculated
Started by: Pat in: Toolset Professional Support |
2 | 3 | 6 years, 10 months ago | ||
CRed user form notification sent after a period of time
Started by: Pat in: Toolset Professional Support |
2 | 3 | 6 years, 11 months ago | ||
Bypass the WordPress image uploader
Started by: Pat
in: Toolset Professional Support
Problem: I would like to add a plugin that rotates images uploaded using CRED. Solution: This type of extension to Toolset is not supported here in the forums, so we have submitted a feature request which will improve CRED to include more robust uploading features. |
2 | 13 | 6 years, 11 months ago | ||
Cred user notification on user meta does not work
Started by: Pat
in: Toolset Professional Support
Problem: Solution: You can find proposed solution with the following reply: Relevant Documentation: |
2 | 3 | 6 years, 11 months ago | ||
Impossible to register a site with Toolset
Started by: Pat in: Toolset Professional Support |
2 | 3 | 6 years, 11 months ago | ||
Custom code to limit parent post selector is not compatible with Select2
Started by: Pat in: Toolset Professional Support |
2 | 6 | 6 years, 11 months ago | ||
WP_Error::getId() with Types + Cred updates
1
2
Started by: Pat in: Toolset Professional Support |
2 | 20 | 6 years, 11 months ago | ||
Search on term field
Started by: Pat
in: Toolset Professional Support
Problem: I have a text search form on my View, and I would like to display a message in the results area until the User submits a search term. If no results are found after searching, I would like to display a different message. If results are found, I would like to display the results. Solution: Use the wpv_filter_query_post_process filter to suppress results until the wpv_post_search parameter is supplied. add_filter( 'wpv_filter_query_post_process', 'drop_empty_textsearch_query', 10, 3 ); function drop_empty_textsearch_query( $query, $view_settings, $view_id ) { $ids = array(1, 2, 3, 4); if (in_array($view_id, $ids)){ if ( !isset($_GET['wpv_post_search']) ) { $query->posts = array(); $query->found_posts = 0; $query->post_count = 0; } } return $query; } Add the wpv_post_param shortcode to your theme's functions.php file to access URL parameters: add_shortcode( 'wpv-post-param', 'wpv_post_param_shortcode' ); function wpv_post_param_shortcode( $atts ) { if ( !empty( $atts['var'] ) ) { $var = (array)$_GET[$atts['var']]; return esc_html( implode( ', ', $var ) ); } } In your View's Loop Output editor, create your results design inside the wpv-loop tags. In the "no results found" area, use conditional HTML and your new wpv-post-param shortcode to determine if the wpv_post_search parameter exists, and display different messages. Relevant Documentation: |
2 | 9 | 7 years ago | ||
Robot cleanup notification arrive 4 times !!!
Started by: Pat in: Toolset Professional Support |
2 | 3 | 7 years ago | ||
Adding product categories to menu automatically
Started by: Pat in: Toolset Professional Support |
2 | 4 | 7 years, 1 month ago | ||
Dcces in product category does not display correct number of pages in pagination
Started by: Pat in: Toolset Professional Support |
2 | 4 | 7 years, 1 month ago | ||
Embedded video from Dailymotion does not display
Started by: Pat
in: Toolset Professional Support
Problem: Solution: Relevant Documentation: |
2 | 16 | 7 years, 1 month ago | ||
How to change the “chose and option” text in WC
Started by: Pat
in: Toolset Professional Support
Problem: Solution: |
2 | 3 | 7 years, 1 month ago | ||
Modify the image orientation in Cred frontend form
Started by: Pat in: Toolset Professional Support |
2 | 4 | 7 years, 1 month ago |