Forums › Forums › Search & Filter Pro › Custom Taxonomies Not Displaying in Results
- This topic has 11 replies, 2 voices, and was last updated 8 years, 10 months ago by
Trevor.
-
Trevor(Private) August 23, 2016 at 8:03 am #55317
Hi Keith
That’s an epic. When you import data using utilities like this, they don’t inform any other WordPress plugin that they have done this. In the case of S&F, that means you have to re-build the cache. If it is not that, then maybe we can talk (voice or video, as opposed to typing on IM) on Skype?
Anonymous(Private) August 24, 2016 at 8:48 pm #55585We 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).
-
AuthorPosts