WP_Query
provides no such date parameter. While you could query for/store the date of the earliest post on the site and then calculate every date for a particular day of the week in the timespan since then and query based on that criteria, it would be far more efficient to track the publish day of week directly.
This could be accomplished with post meta-data, but for query efficiency it would probably make more sense as a taxonomy with a term for each day of the week. As an added benefit of storing this information in a taxonomy, you’ll also get automatic archives and permalinks, which sound as though they might be beneficial here – but you can disable that functionality if not.
Add a hook to look up and set the appropriate day of week term whenever a new course is inserted.
If the archives don’t directly fit your filter needs, your filtration query would be just a matter of specifying the day of week taxonomy/term.
Related Posts:
- Filter WP_Query output before it is accessed (pre_get_posts)?
- How to add taxonomy filter on the query fly?
- Changing Posts Per Page and offset with pre_get_posts
- RSS feed with specific keyword
- Which filter/action hook gets triggered after a query has been performed?
- Including only current user’s posts in search
- WP_Query ignoring tax_query when is_singular
- Applying posts_clauses filter to specific queries only
- Elementor posts custom query based on tag [closed]
- Track write actions to the database
- Using pre_get_posts with WP_Query
- Use REGEXP in WP_Query meta_query key
- WP_Query orderby post__in remains ineffective in the Loop [closed]
- Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
- Hook/action after WP_Query gets posts to query custom tables for post-related meta
- How to uniquely identify queries?
- ajax category filter
- “pre_get_posts” firing on every query
- Using is_main_query to select custom post type on certain page
- SQL Statement generated by WP_Query not producing expected results
- How to pass custom parameter to WP_Query for filtering in pre_get_posts
- Single page theme that uses pages for the content
- How to get any tag ID
- WordPress custom search form with pre_get_posts not work
- order by multiple meta keys in pre_get_posts
- Remove ellipsis from the excerpt retrieved using get_the_excerpt()
- Using pre_get_posts on a specific core/query block
- Searching through different categories on different pages code is not working
- How to implement time filter to show random post 1 month for one category and 3 months for other categories
- When querying a combination of posts and other meta fields, is there a better solution than directly modifying the WHERE value?
- Use ‘parse_query’ filter to show posts that from multiple criteria
- Using apply_filters(‘the_content’, $custom_query->post_content) alters output
- Modifying the Search Results
- Formulate a url to show posts with both taxonomy terms
- Offset Page Loops and Pagination
- pre_get_posts order by not working
- Adding a parameter to the default query
- Using WP_Query in “parse_query” or “pre_get_post” in Posts2Posts
- Single meta_query query using OR instead of AND in request’s WHERE statement
- How to choose between hooking into per_get_posts or into parse_query
- How to use filter hook “the_posts” with a function that refers to $this?
- How to change main query based on post meta
- new WP_Query to get max price meta value not working
- Display posts from only one post form in custom query and exclude in main query
- WP_Query, pre_get_posts and offset
- Complex WP SQL Query
- add_actions called from functions.php not returning good values
- Order by title without taking into account ‘the’
- How can I filter by slug depending on language selection
- How to get all product attributes for filters in WooCommerce?
- A method for ordering mixed dates in search result loop (theory only, no actual code)
- Set global $wp_query/$post variable for dynamic page generation
- Filtering out child category posts from parent category archive not working
- WP_Query with different postmeta filter for each categories
- Slow WP_Query with ‘OR’ on meta_query
- Add posts to WP Query object
- Filter Posts from the Main Query
- Custom post type archive pagination query issue
- Shouldn’t I be able to modify the main query by this filter?
- Hide elements outside loop based on query
- Woocommerce – exclude only older out-of-stock items
- WP Query – order posts by meta field first and then order the rest
- Include posts from some categories while excluding from others
- I need help using pre_get_comments to limit comments in the comments admin screen
- How I can change the condition or compare operator for WP_Query in pre_get_posts
- Change AJAX filter from POST to GET for URL Parameters
- Filtering posts by archive showing all years
- Filter WooCommerce archive pages by an additional category
- Sorting search results with custom dropdown
- Multiple wp_query on archive page
- Retrieve select tag custom values from array and display them in current page with wp_query?
- How to use a dropdown to filter posts by custom field
- Filtering by multiple conditions in the loop
- Custom post type – filter content by custom meta box content
- $wp_query->found_posts not returning correct value
- wp-query and wp_get_post_terms on custom taxonomy archive page
- Display posts ONLY from the current logged in user and current week/year/month Elementor posts
- How do I display main query posts in random order using add_filter
- Replace wp_query with wp_user_query
- Block internal search queries with pre_get_posts and regex rules
- Make a products only viewable to a specific user ID in meta_query pre_get_posts
- Custom meta_query order for Elementor based on post meta key [closed]
- is_user_logged_in not working from WP-API (wp-json)
- Search Exact on WordPress – Relevannsi Solution Not Working
- order posts by a secondary query that counts items
- How can I re-query post_type and rewrite the url?
- Woocomerce – Order products by float attribute in archive pages
- WP Query filters active on wrong query
- Insert wp_query after the_content with plugin (filter the_content won’t work)
- Gather same custom field values in one value in a select tag with wp_query
- In Product Category archives how to show Posts having same/similar prod_cat slug structure?
- Using the same WP_Query for shop and widgets in WooCommerce shop
- Fetch only categorized posts
- Modify query to exclude certain ids and certain parents and its corresponding children
- Adding a Theme Customizer Control for Posts_Per_Page
- Sort posts in dashboard using custom field; also include posts where field isn’t set
- Looking for a way to exclude frontpage and nav menu from query filter
- Custom post types loop on a page template
- Woocommerce set loop_shop_columns to be 3 in the main shop page loop only and 4 otherwise
- List categories using WP_Query