The request to the server is in this phrase: value="?orderby=date&order=DESC">
. That is a WP_query
string. You would use a date_query
with the after
argument to construct a query that will return posts which were published after a certain date. Note that the string will be different every time, since it depends on the current date and time.
Once you have the query, you can pass it through add_query_arg
to retrieve a string which you can include in your dropdown option.
Related Posts:
- get_query stops working after post filter
- Search results sorted by post types
- Why anything done on comments_array hook gets reset?
- Is there a get_post(s) filter that can alter/replace the output completely?
- Sorting and limitation with pre_get_posts
- Filter Media by Featured on Admin
- Add filter to get_posts
- Add Filter not working with get_posts
- Sorting products by price ( regular + sale price )
- get_posts() interrupt because of filter
- how to develop a filter in wordpress to let the user filter the page content depends on the date (newest to oldest etc…)?
- Filter and Search
- How to remove a filter that is an anonymous object?
- How to add defer=”defer” tag in plugin javascripts?
- How do filters and hooks really work in PHP
- Trouble understanding apply_filters()
- How would one modify the filtering Gutenberg applies to pasted content?
- Gutenberg: Is there a way to know if current block is inside InnerBlocks?
- How to reorder billing fields in WooCommerce Checkout template? [closed]
- No filter of code on switch from html to visual editor, how?
- How to modify posts_where filter only for the search query
- How to wrap oEmbed-embedded video in DIV tags inside the_content?
- How to add filter with 2 args?
- WordPress Internal @ Mentions
- Is it possible to use object in add_action?
- Changing text within the Block Editor
- Add Class to Specific Paragraph of the_content()
- apply_filters() slices away needed arguments
- Search content for shortcodes and get parameters
- How to override the email function by using filters? [closed]
- Remove WPML’s home_url filter
- Is it possible to Hook/Filters Attachment Creation?
- Apply the_title filter to post titles AND backend auto social-sharing plugin, but not nav menu
- How to hook some Unicode texts into calendar widget safely?
- How to add attributes to tag when template cannot be directly modified
- Edit pagination text in the get_the_posts_pagination function
- How does WordPress call functions attached to a certain action hook before calling functions attached to other hooks
- How to get current action?
- How to check if “media_send_to_editor” is audio?
- how to change appearence of the content of default post list columns?
- Use safety filters even if after applied intval?
- Modify site URL via functions.php of a theme
- When adding buttons to the tinyMCE editor, how do I make them wrap to the next line and/or display in the “Kitchen Sink” area?
- How to change the order (priority) of registered filters (or actions) (e.g. for the_content)?
- How to change the order of HTML output of a core block?
- How to add ‘total’ value to custom column title on the posts list page
- Is it possible to use multiple spaces in title?
- Create Page Template by hook programatically in Functions.php in WP 5.8.1
- Filter out comments with certain meta key/s in the admin backend
- HTML and custom field variable, inside variable
- WordPress custom admin notice still displays after wp_insert_post_data validation
- how to use force_filtered_html_on_import in add_filter?
- Filter Hook callback error, is it due to using $this inside a filter or something else?
- Run posts_where and posts_join only on the main query
- Disadvantage of using filters & hooks multiple times
- How To Override A WooCommerce AJAX Function
- run shortcode in excerpt of single custom post type
- Get The Caller (Plugin / Theme / Core) For All actions & Hook in WordPress
- How to trim white space in search terms?
- Changing the argument of a function
- Add/remove CRON action depending on variable
- Stripping URLs & Email from post submissions
- comment_for() Custom fields not visible when user is logged in
- Filter authors on meta value
- I’ve set up an extra field for all the available widgets. How do I show it’s value in the front-end?
- Override email_exists function
- Access post ID in “content_save_pre”
- Remove pretty photo style and script if not exist!
- custom gallery filter with image caption as link title?
- Gallery stripped from excerpt of post
- BuddyPress – A hook available to hide custom born date on public profile view?
- The gettext hook doesnt work on text with links
- auth_redirect() doesn’t send users to the page where they orginally tried to acces
- the_content getting current page content instead specified ID
- Custom sort orderby question
- “The editor has encountered an unexpected error” After add defer tag to java script
- Override wordpress audio playlist
- add_action with associative array
- Remove image of srcset
- Add option to query string before get_posts() is called on archive.php
- Modify wp headers on specific page
- Set post featured image to author image
- How can I add a prefix to titles displayed in sidebar using function.php?
- How to make the show as a button?
- List all image sizes still getting disabled sizes
- Why this remove empty paragraphs from the_content does not works?
- Take filter from multiple functions
- Read More in the actual excerpt
- WP REST API v2. filters doesn’t work
- Adding to an array & passing it through do_action/apply_filters
- Is it possible to include the add_filter() function within a shortcode function
- filter on the_content stopped working when I updated to WP 3.6.1
- Replace Paid Shipping Method With Free Shipping Method WooCommerce [duplicate]
- Custom excerpt_more filter not working when tag is present
- Taxonomy search filters
- Is it possible to make get variable out of filter in Class?
- Sorting not working with get_posts
- NextGEN Gallery: Adding drop-down menu widget to gallery view without modifying plugin code [closed]
- Modify the third (context) parameter in a filter?
- Adding filter to the Contact Form 7 response