Title: Using scope as a WP Query parameter
Last modified: April 18, 2023

---

# Using scope as a WP Query parameter

 *  Resolved [shift8](https://wordpress.org/support/users/shift8/)
 * (@shift8)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/using-scope-as-a-wp-query-parameter/)
 * With the multitude of visual page builders and custom post grids, it is not uncommon
   to build a custom post type grid using WP Query parameters in order to filter
   and display the data as a styled/themed grid.
 * With other post types, we can build a WP Query url parameter based filter of 
   the data.
 * With this plugin, I noticed that while this works in the WP Admin events list
   set of filters :
 * `scope=future`
 * This does not work when you actually want to use it as a WP Query parameter, 
   for example the following does **not **work :
 * `&post_type=event&scope=future`
 * Any idea why scope doesnt work in this context? Is there another way of achieving
   this within the WP Query URL parameter method of filtering WP data?

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

 *  [joneiseman](https://wordpress.org/support/users/joneiseman/)
 * (@joneiseman)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/using-scope-as-a-wp-query-parameter/#post-16665990)
 * Can you be more specific? Where is the WP Query URL parameter used? Are you talking
   about the WP REST API? Are you talking about the Query Loop block?
 *  [joneiseman](https://wordpress.org/support/users/joneiseman/)
 * (@joneiseman)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/using-scope-as-a-wp-query-parameter/#post-16670884)
 * You can use [GenerateBlocks](https://generateblocks.com/) to display the events
   in a grid format. Here’s an example of setting a custom WP_Query for the Generateblocks
   Query Loop Block: [https://generatepress.com/forums/topic/how-to-set-up-a-custom-parameter/](https://generatepress.com/forums/topic/how-to-set-up-a-custom-parameter/)
 * The $query_args would be something like this:
 *     ```wp-block-code
       array(
            'post_type' => 'event',
            'meta_key' => '_event_start_date',
            'meta_type' => 'DATE',
            'orderby' => 'meta_value',
            'order' => 'ASC',
            'meta_query' => Array(
                  'meta_key' => '_event_start_date',
                  'type' => 'DATE',
                  'meta_value' => date("m/d/Y"),
                  'meta_compare' => '>='
            )
       )
       ```
   
 * Documentation: [https://docs.generateblocks.com/article/order-query-loop-by-custom-field/](https://docs.generateblocks.com/article/order-query-loop-by-custom-field/)
 * In the post template block you can add a headline block that picks up the dynamic
   data from the post meta: [https://docs.generateblocks.com/article/dynamic-data-options-overview/](https://docs.generateblocks.com/article/dynamic-data-options-overview/)
 * Make sure you put the following in your wp-config.php in order to see the “event”
   post type.
 *     ```wp-block-code
       define('EM_GUTENBERG', true);
       ```
   
 * Some of the meta_keys for events are: _event_start_date, _event_start_end, _event_start_time,
   _event_end_time
 *  [joneiseman](https://wordpress.org/support/users/joneiseman/)
 * (@joneiseman)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/using-scope-as-a-wp-query-parameter/#post-16672995)
 * If you want to use the WP Rest API to filter events based on the meta values (
   e.g., _event_start_date value), see the following post: [https://kayart.dev/wp-rest-api-how-to-filter-posts-by-a-meta-field/](https://kayart.dev/wp-rest-api-how-to-filter-posts-by-a-meta-field/)

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

The topic ‘Using scope as a WP Query parameter’ is closed to new replies.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=3550347)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [joneiseman](https://wordpress.org/support/users/joneiseman/)
 * Last activity: [3 years, 1 month ago](https://wordpress.org/support/topic/using-scope-as-a-wp-query-parameter/#post-16672995)
 * Status: resolved