This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Add tag/category/taxonomy to results page

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Add tag/category/taxonomy to results page

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #21029
    MiguelMiguel
    Participant

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

    #21033
    Ernest MarcinkoErnest Marcinko
    Keymaster

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

    #21044
    MiguelMiguel
    Participant

    You cannot access this content.

    #21055
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi!

    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.

    #21056
    MiguelMiguel
    Participant

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

    #21060
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Add tag/category/taxonomy to results page’ is closed to new replies.