gabrielB
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 |
---|---|---|---|---|---|
Post Relationship Order not working
Started by: gabrielB
in: Toolset Professional Support
Problem: I want a Custom Post Type Relationship (Lecturer) to load in a particular order: alphabetically ascending by custom field value (lecturer-surname): https://toolset.com/forums/topic/post-relationship-order-not-working/#post-1215442 Solution: You can try the WP_Query, like this: https://toolset.com/forums/topic/post-relationship-order-not-working/#post-1216755 Relevant Documentation: |
|
2 | 4 | 5 years, 11 months ago | |
Post Relationship not loading properly in an archive.
Started by: gabrielB
in: Toolset Professional Support
Problem: Solution: In a one-to-many relationship the one is the 'parent' and the many are the 'children'. In a many-to-many relationship that same convention doesn't really make sense, but is used anyway. So the post type on the left is the 'parent' and the post type on the right is the 'child', even though they are more like siblings. You need to specify the 'parent' and 'child' correctly in the function arguments. Here is a generic example to retrieve related posts, using the parent-child convention even for a M2M relationship: $children = toolset_get_related_posts( $parent_id, $relationship_slug, array( 'query_by_role' => 'parent', 'limit' => 999, 'return' => 'post_id', 'role_to_return' => 'child' ) ); Relevant Documentation: |
|
2 | 9 | 6 years, 1 month ago | |
Custom URL Rewrite stops pagination from working in Template pages
Started by: gabrielB in: Toolset Professional Support |
|
2 | 4 | 6 years, 1 month ago | |
Custom query for posts that have custom field checkbox value of 1
Started by: gabrielB
in: Toolset Professional Support
Problem: I would like to write a custom PHP query to find Client posts with a custom checkbox checked. Solution: $args = array( 'post_type' => 'client', 'meta_key' => 'wpcf-checkbox', 'meta_value' => '1', 'orderby' => 'rand', 'posts_per_page' => 8, ); $query = new WP_Query( $args ); Relevant Documentation: |
|
2 | 3 | 6 years, 4 months ago |