WordPress.org

Ready to get started?Download WordPress

Forums

Query Multiple Taxonomies
[resolved] Custom reset not working (8 posts)

  1. LJ902
    Member
    Posted 3 years ago #

    Hi scribu

    First off big thanks for developing this plugin - once it's up and running it's just what I need for a project I working on.

    At the moment though I'm having a bit of an issue with the snippet for changing the page that the reset points to that you posted here:

    http://wordpress.org/support/topic/plugin-query-multiple-taxonomies-customize-reset#post-1624912

    Much like the original poster, I have a page that has the QMT widget on it. On this page (called Find Snapshots) I have a custom query as follows:

    <?php $loop = new WP_Query( array( 'post_type' => 'Snapshots', 'posts_per_page' => 10 ) ); ?>
    <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
                        <?php the_title( '<h2 class="entry-title"><a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a></h2>' ); ?>
    
                        <div class="entry-content">
                            <?php the_content(); ?>
                        </div>
                    <?php endwhile; ?>

    If I use the plugin as-is then everything works as it should. When I land on the page I have a list of custom 'snapshot' posts. For testing purposes I have two test snapshot posts and a single custom taxonomy called job type - test post 1 one tagged with jobtypeA and test post 2 is tagged with jobtypeB. If I use the QMT widget in either dropdown or list format I get the results I would expect

    However, if I reset it takes me to the site home page when I actually want to stay on the 'Find Snapshots' page. I put the code snippet you mentioned in the above thread into my functions file and added the page ID where you indicated.

    Now I seem to stay on the page just fine but the filtering doesn't seem to work properly. Selecting either jobtypeA OR jobtypeB makes no difference to the list of snapshot posts (both remain in the list when only one should remain. If I use the list view on the widget and select both jobtypeA AND jobtypeB both disappear (which is what you would expect)

    At a bit of a loss to explain why this should be the case - any help very gratefully recieved!

  2. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    Did you read this bit, about using the 'qmt_reset_url' filter?

  3. LJ902
    Member
    Posted 3 years ago #

    Thanks for the swift reply!

    I hadn't read that bit though I've just tried it out and also downloaded/installed the dev version you included a link to in the next post to be on the safe side.

    Now I seem to get the following:

    If I use the widget in list mode:

    Clicking on jobtypeA bring up the post with that tag. However, JobtypeB disappears from the list. The same happens in reverse if I click on JobtypeB (Jobtype A disappears)

    in either case, if I click reset it takes me back to the home page.

    If I use the widget in dropdown mode:

    Selecting either JobtypeA or JobtypeB and clicking submit results in a 404.

  4. LJ902
    Member
    Posted 3 years ago #

    scrub that - I don't get a 404 when I use the dropdowns (JobtypeA and JobtypeB both show up in the dropdown initally and when I select one and click submit it displays the correct post. Reset also keeps it on the Find Snapshots page.

    The problem with the list view (which is the one I want to use as I need to give users the opportunity to select multiple job types) still stands though. Any thoughts?

  5. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    Clicking on jobtypeA bring up the post with that tag. However, JobtypeB disappears from the list. The same happens in reverse if I click on JobtypeB (Jobtype A disappears)

    That's because you have no posts with both Jobtype A AND Jobtype B.

  6. LJ902
    Member
    Posted 3 years ago #

    Hi again - sorry for slow reply and thanks very much for the help so far!

    You were right on the money as far as the disappearing jobtypes goes - added another test post with both jobtypes and that seems to have solved things on that score.

    The dropdown now works perfectly including the reset which keeps me on the same (find snapshots) page. However, the list view (which is the one I want to use). Still takes me back to the homepage.

    The filter functionality works just fine, but if I click on the minus sign next to the taxonomy name (which I'm guessing acts as a reset button?) or I remove any currently selected filters, I'm returned to the homepage instead so staying on find snapshots.

    If you have any idea why that would be happening I'd be really grateful. If not then no worries, I can use the dropdown just fine (speaking of which, do you have any plans to make it possible for users to select multiple options from a dropdown - that might be handy).

  7. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    The filter functionality works just fine, but if I click on the minus sign next to the taxonomy name (which I'm guessing acts as a reset button?) or I remove any currently selected filters, I'm returned to the homepage instead so staying on find snapshots.

    This is fixed in the development version (1.3.1-alpha3).

  8. LJ902
    Member
    Posted 3 years ago #

    Awesome - thanks Scribu! Just uploaded the dev version and now it works like a charm. Thanks again for all the support - soon as I get paid for this project I'll bung you some beer tokens! Keep up the good work!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic