Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Add tag/category/taxonomy to results page
- This topic has 5 replies, 2 voices, and was last updated 7 years, 3 months ago by
Ernest Marcinko.
-
AuthorPosts
-
January 29, 2019 at 3:36 pm #21029
Miguel
ParticipantHi Ernest,
I want to include some banners on the results page and those banners will depend on the search category by the user. So if the user search “CARS EVENTS”, he will get banners related to cars and if he chooses “MOTORCYCLES EVENTS” he will get banners related to motorcycles in the results page
As banners can be included as widgets in my theme, I thought maybe I could filter them by adjusting the visibility of the widget with the wordpress visibility options. But for this I need to attach some kind of tag or category or something to the results page to difference one from the other.
Do you have any idea of how we could do this? Maybe using my method or another idea that you can come up with?
Thanks in advance and best regards,
Miguel.January 30, 2019 at 9:51 am #21033Ernest Marcinko
KeymasterHi Miguel,
Are the ‘MOTORCYCLES EVENTS’ and ‘CARS EVENTS’ search phrases or part of the filter? (I can’t check, as the site is under construction, and not accessible)
The only possibility I can think of is running a custom code within the results page, that checks the phrase/filter value, and print the banner based on that. I am not sure if this is possible without custom coding.
February 2, 2019 at 2:08 am #21044Miguel
ParticipantYou cannot access this content.
February 11, 2019 at 1:53 pm #21055Ernest Marcinko
KeymasterHi!
Sorry for the late response, we were on a short family vacation.
Okay, I see how it looks now. I think the best idea in this case is to use a custom code in the search results page to recognize which search instance are the results coming from. I am not sure if there are any widget plugins or anything else available that makes this possible without coding though.
I would use something like this in the search.php file in the theme directory:
if ( $_GET['p_asid'] == 5 ) { // The results coming from the car search, put any custom code here } else { // The results coming from the motorcycle search or somewhere else, put any custom code here }This way you can differenciate between where the results are originating from.
February 11, 2019 at 1:55 pm #21056Miguel
ParticipantHi Ernest, no worries, I saw you were on vacation. Hope you enjoyed.
A friend found the way to solve this problem, so it’s ok!
Talk soon, best regards,
Miguel.February 11, 2019 at 4:22 pm #21060Ernest Marcinko
KeymasterYou cannot access this content.
-
AuthorPosts
- The topic ‘Add tag/category/taxonomy to results page’ is closed to new replies.