Support Forums

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Custom Taxonomies Not Displaying in Results

Viewing 2 posts - 11 through 12 (of 12 total)
  • pneuma33
    #55585

    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).

    Trevor Moderator
    #55607

    Cool. It worked as I suggested it might 🙂 I will close this thread out now.

Viewing 2 posts - 11 through 12 (of 12 total)

The topic ‘Custom Taxonomies Not Displaying in Results’ is closed to new replies.