• Resolved swissmissmi

    (@swissmissmi)


    Awesome plugin. Could easily be a paid plugin! You are rocking it.

    My issue is regarding the loss of the post archive under the following conditions:

    I have three custom taxonomies set up (ex. size, color, brand), all set to display as checkboxes, and each with an “or” operator. Everything works great when there is at least a single variable selected in each of 2 or more of the field types. The result is something like this:
    /?post_types=hats&color=pink&brand=kangol
    Or
    /?post_types=hats&color=pink,blue&brand=kangol,woolrich

    The problem is when only a single variable is selected in a single field. In this example, I’d expect to see all pink hats:
    /?post_types=hats&color=pink

    But instead I get the following url and an error, or a single post where there should be a list of more than a single result:
    /colors/pink/?post_types=hats

    Should I set my permalinks up differently?

    Thanks in advance!

    https://www.ads-software.com/plugins/search-filter/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author DesignsAndCode

    (@designsandcode)

    Hey swissmissmi

    The functionality you are talking about is default of WP.

    If you disable the plugin and go to

    /?color=pink

    WP rewrites will automatically send you to

    /color/pink/

    As far as I can tell, there are two things you can do:

    1. If color is a custom taxonomy, create a seperate template for this archive page in your theme that matches your search results page (or whatever template you want to be loaded) – Look for “Custom Taxonomies display” – https://codex.www.ads-software.com/Template_Hierarchy

    2. Override the WP redirects so that it doesn’t do it – but I find this stuff very confusing and requires a lot of trial an error – https://codex.www.ads-software.com/Rewrite_API

    There is one thing I need to add…

    If you use category in your field lists, this plugin will always rewrite the URL (in addition to WP behaviour) so it looks like this:

    /category/beans/

    In this case you would need to modify your category template to work how you want – or duplicate the search template again…

    I did this so that URLs are cleaner however I can see this may be triggering the loading of the wrong templates for users so might add this in as optional in a future version.

    Let me know how you get on.

    Thanks

    Thread Starter swissmissmi

    (@swissmissmi)

    Thanks for the quick reply!

    I changed permalink settings to default settings (/?p=123) and it works correctly. So, hmmm. I’ll keep you posted!

    Plugin Author DesignsAndCode

    (@designsandcode)

    No worries swissmissmi, I personally like my permalinks so wouldn’t do that…! If you like the layout of the search results page I would copy my “search.php” (in my theme folder) and name it “taxonomy-color.php” – the search template will then be used to display the color taxonomy, which I think is what you are wanting to do!

    Good luck anyway.

    Hi,
    I have the same problem as swissmissmi. I made a custom taxonomy called color. If I change permalink settings to default settings (/?=123) all is fine another way nothing is found as result of custom taxonomy searching.
    I use theme PressWork which has only index.php file to show template.
    As I understood I could name your file search-filter.php to “taxonomy-color.php” and copy it to theme PressWork. Is it right?
    Anyway your plugin is great!
    Thanks,

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Single variable selection problem – permalinks?’ is closed to new replies.