Chris
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 |
---|---|---|---|---|---|
Setting a default post relationship
Started by: Chris
in: Toolset Professional Support
Problem: The issue here is that the user wanted to set a default post relationship . Solution: Unfortunately this is not possible, however a feature request has been submitted for it. |
2 | 3 | 5 years, 8 months ago | ||
Map Marker icons display at wrong size after upgrade to Maps 1.7
Started by: Chris in: Toolset Professional Support |
2 | 7 | 6 years ago | ||
View does not show events from Tribe Events Calendar plugin
Started by: Chris
in: Toolset Professional Support
Problem: I have a View that is supposed to show event posts from Modern Tribe Events Calendar, but it is not working. There is an error displayed: Unknown column 'EventStartDate' in 'order clause' If I add an underscore like '_EventStartDate', the query works. Solution: It seems to be a conflict with the Submit Gravity Form Access Content plugin. |
3 | 17 | 6 years, 2 months ago | ||
Unable to switch from Beta update channel
Started by: Chris in: Toolset Professional Support |
2 | 9 | 6 years, 3 months ago | ||
Infinite scroll load more button
Started by: Chris in: Toolset Professional Support |
3 | 8 | 6 years, 4 months ago | ||
Filter view on whether child posts exist
Started by: Chris
in: Toolset Professional Support
Problem: I would like to give my site visitors the ability to use a checkbox in a custom search View that filters based on whether or not the post has child posts. Solution: This filter is not built-in to Views, but you can set up a custom field on the parent post type that stores a 1 if child posts exists and stores nothing if no child posts exist. That custom field value can be managed automatically with code. add_action( 'toolset_association_created', 'toolset_number_child_posts', 10, 5 ); add_action( 'toolset_before_association_delete', 'toolset_number_child_posts', 10, 5 ); function toolset_number_child_posts( $relationship_slug, $parent_id, $child_id, $intermediary_id, $association_uid ) { // add a 1 if child properties exist to facilitate filtering by existence of child post if( get_post_type($parent_id)=='developments' ) { // get most recent property post $property_args = array( 'numberposts' => 1, 'post_type' => 'property', 'orderby' => 'post_date', 'order' => 'DESC', 'toolset_relationships' => array( 'role' => 'child', 'related_to' => $parent_id, 'relationship' => 'developments_property' ), ); $properties_query = new WP_Query( $property_args ); $properties = $properties_query->posts; if(isset($properties[0])) { // set the checkbox custom field value here using update_post_meta update_post_meta( $parent_id, 'wpcf-has-vacant-properties', 1); }else { delete_post_meta( $parent_id, 'wpcf-has-vacant-properties'); } } } function toolset_count_child_properties_on_save( $post_id ) { if( get_post_type( $post_id ) == 'developments' ) { toolset_number_child_posts( 'developments_property', $post_id, null, null, null ); } } add_action( 'save_post', 'toolset_count_child_properties_on_save', 1000); Relevant Documentation: |
2 | 9 | 6 years, 5 months ago |