rodF
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 |
---|---|---|---|---|---|
Custom field query filter not working
Started by: rodF
in: Toolset Professional Support
Problem: I have a "select" custom field configured on my posts, and a View of these posts filtered by the custom field. The filter does not seem to be working as expected. Solution: In general you should compare the custom field content instead of display text in your Query Filter. For example, on the trustees page you should test to see if the value is "1", not "trustees". Pro tip: use a shortcode attribute to define the value you want to test in your Query Filter. Choose "Board is a string equal to a shortcode attribute 'board'". See the attached screenshot for an example. This way, you can place the same View on each page without needing 3 different Views: Trustees page: [wpv-view name='your-view-slug' board='1'] Planning page: [wpv-view name='your-view-slug' board='2'] Zoning page: [wpv-view name='your-view-slug' board='3'] This is called passing arguments into Views, and it allows you to create dynamic Views that can be reused in different contexts. Relevant Documentation: |
2 | 3 | 7 years ago |