Adding Advanced Search filter to category page, keeping page and sub-categories

  • Jonathan
    Jonathan
    Newbie 6 points
    April 25, 2015 at 10:17 am

    I want to let my users filter listings by area. So I setup an Advanced Search according to a custom “tn_area” field, and that works great.

    But: I want that if a user filters in a category page, he still remain inside that category. But Advanced Search widget takes the user away from the category page! – see screenshots

    Reason: In my site https://tipulnagish.co.il the category distinction and descriptions are very important to me. So, my homepage links to category pages (which prominently display description and sub-categories), and all searching/filtering must keep that display.

    Attachments:
    You must be logged in to view attached files.
  • Jonathan
    Jonathan
    Newbie 6 points
    May 1, 2015 at 10:06 am

    Cause: Advanced Search widget has a form with an action that redirects to homepage. This is hardcoded in:

    framework\class\class_search.php ! build_form():
      echo (...) action="' . esc_url( home_url( '/' ) ) (...) ;

    I might raise a feature request about this later on…

    My solution: Remove in client-side script. Add in Design Setup >Custom Meta Data >Footer Styles:

    <script>
      jQuery(".paddingtop20 h1").remove()
    </script>
    
Viewing 2 posts - 1 through 2 (of 2 total)

New Business Themes for WordPress 2020

Start your new website today!

View Business Themes