Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jonathandejong

    (@jonathandejong)

    Hi Salvia,

    The filtering all occurs on the main archive page rather than sending people to the single term archive. This is necessary in order to be able to filter on multiple different taxonomies at once:
    https://www.mysite.com/post_type/taxonomy/term/taxonomy2/term2 etc.

    The URL rewriting makes sure that instead of seeing this:
    https://www.mysite.com/post_type/?taxonomy=term&taxonomy2=term2 you see the above. So it does not affect and is not the same as your .com/term url.

    If all you want is a dropdown that sends your visitor to a single terms archive you should have a look at this WordPress Codex page:
    https://codex.www.ads-software.com/Function_Reference/wp_dropdown_categories#Examples

    If you want your visitors to be able to (and be able to link to) use the .com/term url and redirect them to the corresponding filtered archive page (.com/post_type/taxonomy/term) you should look at creating your own htaccess redirects. I’m not an expert but I’m sure you can find help with this in the WordPress forums or on stackoverflow.com

    Does that answer your question? ??

    Thread Starter salvia34

    (@salvia34)

    Hello Jonathandejong!

    Thanks for your relevance response!

    I know the “wp_dropdown_categories” function, but I love your plugin and its various functions (select2, Polylang compatibility, etc..).

    The plugin works very well for me, is it not possible to just tell me what file I need to change to change only the destination link? (just remove “/post_type/”)

    Thank you in case, and too bad for me if it is definitely not possible.

    Plugin Author Jonathandejong

    (@jonathandejong)

    Hi Salvia,

    Thank you for those kind words.

    Unfortunately it is not as simple as editing some files. The core functionality of the filter is depending on that URL structure. What’s going on when you’re on a filtered page is that you are actually still at the regular post archive (mysite.com/post_type) but the filter appends some parameters (?taxonomy=term&taxonomy2=term2) which WordPress interprets and uses in it’s standard wp_query.

    You can see how the taxonomies and terms are added to the wp_query by looking at the global $wp_query object in your archive.php file (after you’ve set a filter):

    <?php global $wp_query; ?>
    <pre><code><?php print_r($wp_query, true); ?></code></pre>

    So what you want would not allow anyone to filter on multiple taxonomies at the same time since you cant do “mysite.com/term/term2” (which can be in different taxonomies or not). If that doesn’t bother you and you’re fine with the visitors only being able to filter on one taxonomy at a time you’d have to code your own version of this.
    Then you can use the javascript submission version found in the wp_category_dropdown article (to avoid ppl trying to submit multiple taxonomies) and apply select2 by yourself. But using this plugin for it would be like breaking down a mountain in order to get to the eagles nest. It would be easier to climb the mountain yourself ?? (I never get do to cool analogies).

    Thread Starter salvia34

    (@salvia34)

    Hi Jonathan!

    Sorry to answer only now, and thank you for your appropriate response. I’ll try using your information to find a solution.

    There have been many updates to the plugin since my first post, maybe my problem is solved? Could you confirm?

    Thank you for all!
    Cheers

    Plugin Author Jonathandejong

    (@jonathandejong)

    Hi Salvia,

    No problem!
    There hasn’t been any changes to how the filter or URL structure work no.

    However if I understood your request correctly I explain in the previous post how you can achieve this yourself without using any plugins since what you want to do is actually much simpler than the filtering created by this plugin.

    Cheers!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Disable URL Rewriting’ is closed to new replies.