Title: generateblocks_query_loop_args
Last modified: June 16, 2023

---

# generateblocks_query_loop_args

 *  Resolved [Mark Smallman](https://wordpress.org/support/users/marks99/)
 * (@marks99)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/generateblocks_query_loop_args/)
 * Hi,
   I have a dropdown which it is planned to allow ‘sorting’ of listings within
   a QueryLoop. The dropdown/select is created by a shortcode on the page. I then
   have a JS file that adds a class to ‘gb-query-loop-wrapper’. Then the PHP from
   the **[GIST](https://gist.github.com/macgraphic/2cd1ba41afd2ec5e51880c1e9dfb80c5)**
   adds/removes the class to the wrapper.I can see it is adding the class as expected
   to the wrapper, but it’s not changing the ordering of the loop.Is it not possible
   to do this, or is there something else I’ve missed?Thanks, Mark
    -  This topic was modified 2 years, 10 months ago by [Mark Smallman](https://wordpress.org/support/users/marks99/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fgenerateblocks_query_loop_args%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [Mark Smallman](https://wordpress.org/support/users/marks99/)
 * (@marks99)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/generateblocks_query_loop_args/#post-16825082)
 * The shortcode: [https://gist.github.com/macgraphic/0ea19308faa6c5b09f4bac85aacdc84a](https://gist.github.com/macgraphic/0ea19308faa6c5b09f4bac85aacdc84a)
 * The JS File:
   [https://gist.github.com/macgraphic/6cd5590b0083355697b85bbe65ff8c7a](https://gist.github.com/macgraphic/6cd5590b0083355697b85bbe65ff8c7a)
    -  This reply was modified 2 years, 10 months ago by [Mark Smallman](https://wordpress.org/support/users/marks99/).
 *  Plugin Support [ying](https://wordpress.org/support/users/yingscarlett/)
 * (@yingscarlett)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/generateblocks_query_loop_args/#post-16825348)
 * Hi [@marks99](https://wordpress.org/support/users/marks99/) ,
 * This won’t work, the query loop can not be sorted simply like this, unfortunately.
 * In your case, you might need to add the sorting to the default WP archive page.
 *  [fernandoazarcon2](https://wordpress.org/support/users/fernandoazarcon2/)
 * (@fernandoazarcon2)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/generateblocks_query_loop_args/#post-16870171)
 * Hi there! We haven’t heard back from you for a while now so we’re going to go
   ahead and set this topic as resolved. Feel free to reply if you need any more
   help.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘generateblocks_query_loop_args’ is closed to new replies.

 * ![](https://ps.w.org/generateblocks/assets/icon.svg?rev=3239461)
 * [GenerateBlocks](https://wordpress.org/plugins/generateblocks/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/generateblocks/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/generateblocks/)
 * [Active Topics](https://wordpress.org/support/plugin/generateblocks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/generateblocks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/generateblocks/reviews/)

## Tags

 * [query loop](https://wordpress.org/support/topic-tag/query-loop/)

 * 3 replies
 * 3 participants
 * Last reply from: [fernandoazarcon2](https://wordpress.org/support/users/fernandoazarcon2/)
 * Last activity: [2 years, 9 months ago](https://wordpress.org/support/topic/generateblocks_query_loop_args/#post-16870171)
 * Status: resolved