{"id":31965,"date":"2010-05-12T19:34:53","date_gmt":"2010-05-12T23:34:53","guid":{"rendered":"http:\/\/wpmu.org\/?p=31965"},"modified":"2013-06-13T21:15:05","modified_gmt":"2013-06-14T01:15:05","slug":"daily-tip-how-to-display-wordpress-archives-in-a-drop-down-menu","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/daily-tip-how-to-display-wordpress-archives-in-a-drop-down-menu\/","title":{"rendered":"How To Display WordPress Archives in a Drop Down Menu"},"content":{"rendered":"<p><a rel=\"lightbox[31965]\" class=\"blog-thumbnail\" href=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2010\/05\/archives.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-31966\" title=\"archives\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2010\/05\/archives.png\" alt=\"Post image\" aria-hidden=\"true\" width=\"158\" height=\"88\" \/><\/a>Sometimes you don&#8217;t want your archives taking up much space in your sidebar, footer, or elsewhere.<\/p>\n<p>Here&#8217;s a snippet that you can add anywhere in your template files to display a drop-down menu of your archives in order to conserve space:<\/p>\n<pre>&lt;select name=\"\\\"archive-dropdown\\\"\" onchange=\"document.location.href=this.options[this.selectedIndex].value;\"&gt;&lt;?php echo attribute_escape(__('Select Month')); ?&gt;&lt;?php wp_get_archives('type=monthly&amp;format=option&amp;show_post_count=1'); ?&gt;\r\n\r\n<\/pre>\n<p>This will produce a little something like what&#8217;s shown in the thumbnail above.<\/p>\n<p style=\"font-size: 11px;\">Source: <a href=\"http:\/\/wphacks.com\/how-to-build-a-categories-and-archives-drop-down-box-2\/\" rel=\"noopener\" target=\"_blank\">WPhacks.com<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes you don&#8217;t want your archives taking up much space in your sidebar, footer, or elsewhere. Here&#8217;s a snippet that you can add anywhere in your template files to display a drop-down menu of your archives in order to conserve space: &lt;select name=&#8221;\\&#8221;archive-dropdown\\&#8221;&#8221; onchange=&#8221;document.location.href=this.options[this.selectedIndex].value;&#8221;&gt;&lt;?php echo attribute_escape(__(&#8216;Select Month&#8217;)); ?&gt;&lt;?php wp_get_archives(&#8216;type=monthly&amp;format=option&amp;show_post_count=1&#8217;); ?&gt; This will produce a little [&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":[263],"tags":[87],"tutorials_categories":[],"class_list":["post-31965","post","type-post","status-publish","format-standard","hentry","category-tutorials","tag-menus"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/31965","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=31965"}],"version-history":[{"count":5,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/31965\/revisions"}],"predecessor-version":[{"id":182093,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/31965\/revisions\/182093"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=31965"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=31965"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=31965"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=31965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}