Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Taxonomy in Advanced Title and Description Fields
- This topic has 3 replies, 2 voices, and was last updated 4 years, 4 months ago by
Ernest Marcinko.
-
AuthorPosts
-
January 27, 2022 at 8:27 pm #36434
HighFitness49
ParticipantOn 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?January 28, 2022 at 10:25 am #36437Ernest Marcinko
KeymasterHi,
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.January 28, 2022 at 6:26 pm #36464HighFitness49
ParticipantPerfect – Thanks for the clarification Ernest. Many thanks!
January 29, 2022 at 12:28 pm #36466Ernest Marcinko
KeymasterYou cannot access this content.
-
AuthorPosts
- You must be logged in to reply to this topic.