MC
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 |
---|---|---|---|---|---|
Divi theme not working with wp-views plugin
Started by: MC in: Toolset Professional Support |
2 | 4 | 5 years, 3 months ago | ||
Display sorted repeating field values
Started by: MC
in: Toolset Professional Support
Problem: I have a repeating field that includes simple text strings. I would like to display the values of that field in alphabetical order. Solution: It could be complicated if the field accepts HTML, or if special characters or complex fields are considered. If you just want a basic text comparison on a simple Types field, you can add this custom shortcode to your child theme's functions.php file or create a new snippet in Toolset > Settings > Custom Code: add_shortcode( 'ts-sort-multi-field-values', 'ts_sort_multi_field_values_func'); function ts_sort_multi_field_values_func( $atts, $content ) { global $post; $a = shortcode_atts( array( 'direction' => 'ASC', 'slug' => '', 'glue' => ', ', ), $atts ); $vals = get_post_meta($post->ID, 'wpcf-' . $a['slug']); if($a['direction'] == 'ASC') usort($vals, "alpha_vals_asc_cmp"); if($a['direction'] == 'DESC') usort($vals, "alpha_vals_desc_cmp"); return implode($a['glue'], $vals); } function alpha_vals_asc_cmp($a, $b) { $stra = strtolower($a); $strb = strtolower($b); $res = 0; if ( $stra < $strb) { $res = 1; } return $res; } function alpha_vals_desc_cmp($a, $b) { $stra = strtolower($a); $strb = strtolower($b); $res = 0; if ( $stra > $strb) { $res = 1; } return $res; } Then use the shortcode like this to display a sorted list of the field values: [ts-sort-multi-field-values slug='your-field-slug' direction='ASC' glue=', '] Replace your-field-slug with the slug of your custom field. Direction can be ASC or DESC, and glue is the separator between values. |
2 | 5 | 6 years, 1 month ago | ||
Hide taxonomy custom search filter until post relationship custom search filter is selected
Started by: MC in: Toolset Professional Support |
2 | 3 | 6 years, 1 month ago | ||
Result do not show Divi styling fully
Started by: MC
in: Toolset Professional Support
Problem: When I filter a View with AJAX, the first result isn't styled correctly. Solution: |
2 | 7 | 6 years, 1 month ago | ||
Show relationship with custom search
Started by: MC in: Toolset Professional Support |
2 | 5 | 6 years, 3 months ago |