WordPress.org

Ready to get started?Download WordPress

Forums

Query Multiple Taxonomies
Change base URL example not working for dropdowns (6 posts)

  1. Jeff
    Member
    Posted 2 years ago #

    Using the example code from https://github.com/scribu/wp-query-multiple-taxonomies/wiki/Changing-URLs

    function my_qmt_base_url( $base ) {
        $additional_args = array(
            'orderby' => 'title',
            'order' => 'asc',
        );
    
        return add_query_arg( $additional_args, $base );
    }
    add_filter( 'qmt_base_url', 'my_qmt_base_url' );

    I am finding that the qmt_base_url is not being filtered when the widget is set to dropdowns but is fine when using lists. See example results with the test website url anonymised:

    http://www.example.com/?videoscategory=talks&videospersonalities=zephaniah&videosplace=&videosyear=&videoslevels=

    http://www.example.com/?orderby=title&order=asc&videoscategory=talks&videospersonalities=zephaniah

    Is there anything to do about this as dropdowns work much better on the site I'm developing?

    http://wordpress.org/extend/plugins/query-multiple-taxonomies/

  2. Paglalakbay
    Member
    Posted 2 years ago #

    Hi upekshapriya,

    Have you tried doing something like this to test:

    function my_qmt_base_url( $base ) {
        return 'your_URL';
    }
    add_filter( 'qmt_base_url', 'my_qmt_base_url' );

    replace 'your_URL' with what you want your base URL to be.

  3. Jeff
    Member
    Posted 2 years ago #

    The problem isn't that the example code that I quote above doesn't work - it's that the dropdown version of the widget doesn't seem to work properly - the modified base url appears perfectly within the form html that I can view within the source code of the web page - and as I stated above it all works fine in the list version of the widget :-)

    I am wondering if there's a bug in the QMT code or if I can modify the dropdown.html template to solve this?

  4. Paglalakbay
    Member
    Posted 2 years ago #

    Hi,

    I see what you mean. If you're using dropdowns the additional arguments orderby and order are not added to the address query, but you can see it in source view.

    Don't think you can do anything in the template to fix this. Never really noticed this before since I use the template to sort results.

  5. Jeff
    Member
    Posted 2 years ago #

    Any ideas what might be going wrong in the plugin? Or has something changed in WordPress in later versions to cause this anomaly?

  6. Paglalakbay
    Member
    Posted 2 years ago #

    I don't really know. As I said, I haven't really noticed this issue.

    Scribu said he has stopped supporting this plugin. There's a 1.6-alpha but I don't think that's working.

    The way I'm doing it now, I have a bunch of taxonomy templates and just manipulate the queries on the template. Dunno if that will work for you though.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic