WordPress.org

Ready to get started?Download WordPress

Forums

Add categories filter links to restrict search results (5 posts)

  1. baalstorm
    Member
    Posted 3 years ago #

    Hi, i'm trying to enhance the search result page with links displaying all the categories of my site, allowing users to restrict the search within that specific one (see attached file with highlighted result i want to achieve) . Thank you

    attachment

  2. s_ha_dum
    Member
    Posted 3 years ago #

    What have you done to try to make this work? How do you hope it will work? The easiest way is to make anchors out of the category links and have the search page parse the $_GET strings. Or you could get fancy and use Javascript.

  3. baalstorm
    Member
    Posted 3 years ago #

    nothing so far, just searched through forums and blogs. i have to say i'm not that into pro scripting, so.. thanks for the tip, btw :)
    hope you could be a little more specific about the parsing thing, perhaps? i'll try to be a bit more clear about the process:
    search a term > get a result page with the possibility to click on the category links and restrict the result only within it

    something like this, but with links instead of checkboxes

  4. s_ha_dum
    Member
    Posted 3 years ago #

    hope you could be a little more specific about the parsing thing, perhaps?

    Sure. I just try not to ramble on too much when I don't know exactly what you are trying to accomplish. :)

    You'll need to start here. You will need to set up a search page that you can manipulate. I think you can probably pull this off by making search.php and searchform.php files. Just follow the instructions.

    Your category anchors are going to have category parameters tacked to the end, like so ?cat=4. There are several different ways you can do it. Then you are going to give those parameters to query_posts. The two links I provided have some examples of that too. Read through those and see if they make sense.

  5. baalstorm
    Member
    Posted 3 years ago #

    great! i'll have a look, thanks a lot :)

Topic Closed

This topic has been closed to new replies.

About this Topic