- This topic has 11 replies, 2 voices, and was last updated 8 years, 4 months ago by .
These forums are now closed and remain for historical purposes.
None of the content applies to the new version 3. For support, get in touch via our contact form.
Forums › Forums › Search & Filter Pro › Custom Taxonomies Not Displaying in Results
We got it fixed. Thanks Trevor! Here was the resolution:
I am using the ACF taxonomy field on the edit screen to provide a better user interface for adding taxonomies (I wanted the site admin to be able to search and pick from a list of existing values instead of typing them, and also restrict them to one choice).
It turns out there is a miscommunication between S&F and ACF. S&F had a hard time reading the ACF value for those taxonomy terms as they were output in the results table. You’ll notice I was using the ACF field to try to output the taxonomy term into the search results. That’s where the breakdown occurred. Turns out that was unnecessary because I had also linked the ACF taxonomy field to the CPT custom taxonomy.
The resolution here was to output the taxonomy term using a WordPress function, get_the_terms(), instead of the ACF function. This is what I changed from the code in my first post:
<div class="inv_make"><?php echo get_the_terms(get_the_ID(), 'vehicle_make')[0]->name; ?></div>
<div class="inv_model"><?php echo get_the_terms(get_the_ID(), 'vehicle_model')[0]->name; ?></div>
I will note here that I’m only allowing one term per taxonomy which is why I don’t have this in a loop (which I would need if there was more than one term per taxonomy).
This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
We also use cookies to store items in your cart as well as allowing your to login on the site.
You can adjust all of your cookie settings by navigating the tabs on the left hand side.
By continuing to use this site, you also agree to our Privacy Policy.
Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.
*Other cookies used for logging in and cart functions will only be used when you use those features and cannot be disabled.
If you disable these cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.
This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.
Keeping this cookie enabled helps us to improve our website.
Please enable Strictly Necessary Cookies first so that we can save your preferences!
More information about our Cookie Policy