{"id":33277,"date":"2010-06-06T13:20:51","date_gmt":"2010-06-06T17:20:51","guid":{"rendered":"http:\/\/wpmu.org\/?p=33277"},"modified":"2012-10-02T23:36:09","modified_gmt":"2012-10-03T03:36:09","slug":"daily-tip-how-to-show-a-post-from-exactly-one-year-ago-today","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/daily-tip-how-to-show-a-post-from-exactly-one-year-ago-today\/","title":{"rendered":"How to Show a Post From Exactly One Year Ago Today"},"content":{"rendered":"<p>There may be certain special occasions where you&#8217;d like to show a post from one year ago.<\/p>\n<p>Perhaps you&#8217;d like to dedicate a portion of your sidebar or footer to show a post from exactly one year ago. Drop this snippet anywhere in your theme&#8217;s template files where you want the post to appear:<\/p>\n<pre>&lt;?php\r\n$current_day = date('j');\r\n$last_year = date('Y')-1;\r\nquery_posts('day='.$current_day.'&amp;year='.$last_year);\r\nif (have_posts()):\r\nwhile (have_posts()) : the_post();\r\nthe_title();\r\nthe_excerpt();\r\nendwhile;\r\nendif;\r\n?&gt;<\/pre>\n<p style=\"font-size: 12px;\">Source: <a href=\"http:\/\/www.wprecipes.com\/how-to-get-posts-published-exactly-one-year-ago\" rel=\"noopener\" target=\"_blank\">WP Recipes<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There may be certain special occasions where you&#8217;d like to show a post from one year ago. Perhaps you&#8217;d like to dedicate a portion of your sidebar or footer to show a post from exactly one year ago. Drop this snippet anywhere in your theme&#8217;s template files where you want the post to appear: &lt;?php [&hellip;]<\/p>\n","protected":false},"author":4099,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"blog_reading_time":"","wds_primary_category":0,"wds_primary_tutorials_categories":0,"footnotes":""},"categories":[1,557,263],"tags":[],"tutorials_categories":[],"class_list":["post-33277","post","type-post","status-publish","format-standard","hentry","category-news-community","category-development","category-tutorials"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/33277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/users\/4099"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/comments?post=33277"}],"version-history":[{"count":2,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/33277\/revisions"}],"predecessor-version":[{"id":182992,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/33277\/revisions\/182992"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=33277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=33277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=33277"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=33277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}