WordPress.org

Ready to get started?Download WordPress

Forums

Filter multiple tags with a checkbox input form (3 posts)

  1. Ble1frei
    Member
    Posted 3 years ago #

    Hi,

    I need some help creating a tags filter input checkbox form. The form is located at top of the page.

    The index.php contains following code:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    After checking the two checkboxes "tag1" and "tag2" and hitting the submit button, the following url is loaded:
    http://www.myhome.de/?tags0=tag1&tags1=tag2
    This url doesn't work, it doesn't filter any tags.

    The $url variable contains this:
    "http://www.myhome.com/tag/tag1,tag2"

    The problem is the wp_redirect doesn't work. The page just stops loading at exit; without redirecting to "http://www.myhome.com/tag/tag1,tag2".

    Maybe someone has a hint, maybe there is a better technique for solving this kind of problem in WordPress?

  2. wkayh
    Member
    Posted 3 years ago #

    [Code moderated as per the Forum Rules. Please use the pastebin]

    I was able to get this to work. I was getting 404 page errors if there was not a post tagged with the selection I choose. All I did was remove the [] with the "name" of the input.

  3. drdrstudio
    Member
    Posted 2 years ago #

    I have a similar question and woudl love to have seen the code that was moderated out of this thread. Wkayh or Ble1frei - do either of you have an example of this code you could post? Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic