Taxonomy in Advanced Title and Description Fields

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Taxonomy in Advanced Title and Description Fields

This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 3 months, 2 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #36434
    HighFitness49
    HighFitness49
    Participant

    On this page – https://dev.highfitness.com/find-a-class/ – on the Search By Instructor Tab I’m trying to use the Advanced Title and Description fields to format the results for my custom post type called Classes. My goal is to get my results looking somewhat like the results on the Search By Location tab.

    I am able to get my custom fields to display, but my taxonomies will not show. I have several taxonomies I’d like to display – venue, class_day, class_format, and class_type.

    I believe I should be able to bring the tag up using {__tax_category} or {_tax_category}, so I’ve tried both {__venue} and {_venue}, but neither will display the venue associated with the post.

    I only have a single class in the system for testing, and my search is set up to only search by author name, so you can test this search by searching the author ‘highadmin’

    In my Advanced Title Field I have the following:
    {__author} – {_venue} {venue_address}

    In my Advanced Description Field I have the following:
    <p>{_class_format} – {_class_type}</p>
    <p>{_class_day} @ {class_start_time} – {class_price}</p>
    <p>{descriptionfield}</p>

    What is the correct method for displaying the taxonomies associated with each post in these fields?

    I also have two other issues I may as well bring up rather than stretching them out into multiple tickets.

    1 – I noticed that if I hit enter on the search field that the site brings up a site wide search of the term entered. Is there a way to prevent that from happening?
    2 – I noticed that if I have search results on screen and I switch back to the Search By Location tab that the results stay on the screen and obscure the content of that tab. Under Advanced Visual Options I’ve turned on the option to hide the search box if it becomes invisible but that isn’t preventing this behavior. My site is built on Divi – is there a way to hide the search results when the tab gets switched that I’m not seeing?

    #36437
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    To display taxonomies, use the “__tax_” prefix for them, ex.:

    {__tax_venue}

    That will do the trick 🙂

    1. Sure, you can set the magnifier/return events to not trigger and not do anything: https://documentation.ajaxsearchpro.com/behavior/return-key-and-magnifier-icon-click-actions
    2. I think the best approach here is to change the results layout to “block or custom” instead of the hovering: https://i.imgur.com/4iCdu0u.png
    In that case the results container will remain in the same tab as the search bar, and switching the tabs will also “hide” the results.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #36464
    HighFitness49
    HighFitness49
    Participant

    Perfect – Thanks for the clarification Ernest. Many thanks!

    #36466
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.