The query_posts
function documentation does give an example on how to filter by time as well. Albeit, small and out of context.
The WP_Query
documentation give much more information, including on Time Parameters that it accepts. query_posts
is just a wrapper to methods provided by the global instance of the WP_Query
class.
So, the correct argument set would be something of this sort:
$args = array(
'tag' => 'the-tag',
'year' => get_query_var( 'year' ),
'month' => get_query_var( 'monthnum' )
);
query_posts( $args );
get_query_var
will usually contain the year and the month for an archive.
Related Posts:
- URL scheme to retrieve tag archive by ID
- Need sql to remove tags from older posts
- Highlight current tag using get_tags()
- How to get links to previous and next archive page based on tag
- How can I combine WordPress default Tags and bbPress tags into one archive page?
- how do I get the tag name from tag id?
- Do tags have dates?
- Display tags in list without link
- How can you tie into the tag metabox?
- Display tags for current post in sidebar
- How important are WordPress tags for SEO purposes?
- Massive Tags Remove Using MySQL
- Quicktags on all textarea.. Not working on plugin?
- how to change # of tag posts on /tag page?
- How can I remove certain HTML tags from the RSS feed?
- Stop WordPress removing tags when switching from HTML to Visual (TinyMCE)
- Link directly to the first post in an archive
- Set homepage to only display posts from one tag
- Individual css class for each tag in wp_tag_cloud
- Strict tag list – user should choose only existing tags for posts
- How to filter archives both by category and tag?
- Special characters in tag get removed for comparison on save
- Display custom list of tags in post/page editor with hooks
- How to remove ‘noindex, follow, max-image-preview:large’ in search page WordPress 5.7 up
- Displaying Posts by tag dynamically in WordPress
- How to rename ‘TAG’ to ‘TOPIC’
- How to not show tags if the post doesn’t have any?
- Don’t show a tag on a post if it is the only post with that tag
- Remove the last character from tag name in tag archive page
- How to Override “Blog pages show at most” in tag.php [duplicate]
- Return post tags with description
- How to display tag cloud without links
- Get tags for post_type
- Line of Tag information Is Formatted Strange
- How can I make an auto-fill search box auto-completing with the tags?
- How to get the Tags on Publish post hook?
- woocommerce product tags display
- Please help me to figure out how to display my tags
- Cross Site Related Posts?
- TinyMCE – how to select tags node from the place where the caret is?
- List tags by certain letter issue with special chars like å, ä and ö
- Strip and tags from a specific div
- Require tags for bbPress topics [closed]
- How to enable all Tag Descriptions in loop?
- WordPress Tag Page Hook?
- /tag/tag_name/page/2 gives a 404 error
- How can i order get_the_tags?
- Add text to Title dynamically using tags
- Function filter breaking tag archive menus
- “ Language notation in the post content
- How to make tag pages look as /tags/%tagname%/ in the URL?
- WordPress tags as twitter sharer URL hastags
- Get Tag Slugs that start with a word
- Add post tag without post id
- Show all videos by tag name
- Changing H1 to Normal Links
- Problem using the word “RSS” as a tag
- Print_r displaying two different post->ID if placed in sidebar or single.php
- Detect tag page and include an Image for that specific tag
- Buddypress – Adding Tags in Profile
- Do not run this code on posts with a specific tag!
- Automatically add tag (first 4 characters) to uploaded media
- How can I automatically hyperlink tag names that are in my post body to the tag page
- Calling an Archive Page with specific Tag/Tax ID
- wp-cli error: “Term is missing a parent”
- Add a specific tag to default tag list
- Random tag in the post
- Remove little gray box from content page
- Get the publish date of the older post inside a tag
- How to test if the tag list is empty for the current page?
- Replace -tag in the_excerpt
- Get X post tags
- Can / should / how should I convert my WordPress categories to tags?
- Insert text BEFORE the “tag” title
- Title tag come up differently on search results
- Why doesn’t the_tags( ) accept empty string for first argument?
- tag based subscription
- Remove parentheses from tag cloud count
- Change the Page Title of the Archive Page for Portfolio Tags
- the_tags outputs before echo
- Custom Post Type tag taxonomy “Page Not Found”
- Only display posts with a specific tag
- Prevent tag creation on the post edition page
- showing tag beside catagory
- Conditional tag for attachment posts
- Archive.php is not displaying tags
- Get multiple tags by slug
- How To get a list of popular tags by post views?
- Post order by selected tags
- WordPress editor, change code wrap (bbpress?)
- Get TOP x Tags from selected posts
- post specific tag cloud, how to display in descending order from popular to less?
- Tags as autocomplete values
- Need to return all tags – including empty ones – in list
- How do I exclude categories from get_tags?
- How can I add meta tags in the WordPress header?
- How to have H1 for site title only on Homepage?
- Custom message if tag returns empty results
- Attachment tag archive
- wordpress assign all existing tags to a specific post