{"id":37032,"date":"2015-06-18T10:41:50","date_gmt":"2015-06-18T10:41:50","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/expanding-archives\/"},"modified":"2024-03-23T14:55:19","modified_gmt":"2024-03-23T14:55:19","slug":"expanding-archives","status":"publish","type":"plugin","link":"https:\/\/eo.wordpress.org\/plugins\/expanding-archives\/","author":14336890,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"2.1.0","stable_tag":"trunk","tested":"6.4.8","requires":"3.0","requires_php":"7.4","requires_plugins":null,"header_name":"Expanding Archives","header_author":"Ashley Gibson","header_description":"","assets_banners_color":"","last_updated":"2024-03-23 14:55:19","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/www.paypal.com\/cgi-bin\/webscr?cmd=_s-xclick&hosted_button_id=L2TL7ZBVUMG9C","header_plugin_uri":"https:\/\/shop.nosegraze.com\/product\/expanding-archives\/","header_author_uri":"https:\/\/www.nosegraze.com","rating":4.7,"author_block_rating":0,"active_installs":2000,"downloads":23099,"num_ratings":6,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.0":{"tag":"1.0.0","author":"NoseGraze","date":"2015-06-18 10:42:38"},"1.0.1":{"tag":"1.0.1","author":"NoseGraze","date":"2015-06-30 09:56:34"},"1.0.2":{"tag":"1.0.2","author":"NoseGraze","date":"2015-08-12 09:53:16"},"1.0.3":{"tag":"1.0.3","author":"NoseGraze","date":"2015-11-19 00:13:01"},"1.0.5":{"tag":"1.0.5","author":"NoseGraze","date":"2016-06-15 14:17:44"},"1.1.0":{"tag":"1.1.0","author":"NoseGraze","date":"2016-08-27 14:41:04"},"1.1.1":{"tag":"1.1.1","author":"NoseGraze","date":"2019-02-16 13:17:32"},"2.0":{"tag":"2.0","author":"NoseGraze","date":"2022-01-23 13:07:06"},"2.0.1":{"tag":"2.0.1","author":"NoseGraze","date":"2022-01-31 11:44:43"},"2.0.2":{"tag":"2.0.2","author":"NoseGraze","date":"2022-02-03 13:08:18"},"2.1.0":{"tag":"2.1.0","author":"NoseGraze","date":"2024-03-23 14:55:19"}},"upgrade_notice":{"2.1.0":"<ul>\n<li>Added support (via a filter) for specifying a cut-off date. See readme FAQ for details.<\/li>\n<\/ul>"},"ratings":{"1":0,"2":0,"3":0,"4":2,"5":4},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0","1.0.1","1.0.2","1.0.3","1.0.5","1.1.0","1.1.1","2.0","2.0.1","2.0.2","2.1.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":2662301,"resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":2662301,"resolution":"2","location":"assets","locale":""},"screenshot-3.png":{"filename":"screenshot-3.png","revision":2662301,"resolution":"3","location":"assets","locale":""}},"screenshots":{"1":"The widget on my blog. This version has custom CSS applied.","2":"The widget on the Twenty Fifteen theme, with only the default styles applied.","3":"No widget settings - just add and save!"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[3621,1753,166,168,162],"plugin_category":[43],"plugin_contributors":[86079],"plugin_business_model":[],"class_list":["post-37032","plugin","type-plugin","status-publish","hentry","plugin_tags-archives","plugin_tags-navigation","plugin_tags-posts","plugin_tags-sidebar","plugin_tags-widget","plugin_category-customization","plugin_contributors-nosegraze","plugin_committers-nosegraze"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/expanding-archives.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/expanding-archives\/assets\/screenshot-1.png?rev=2662301","caption":"The widget on my blog. This version has custom CSS applied."},{"src":"https:\/\/ps.w.org\/expanding-archives\/assets\/screenshot-2.png?rev=2662301","caption":"The widget on the Twenty Fifteen theme, with only the default styles applied."},{"src":"https:\/\/ps.w.org\/expanding-archives\/assets\/screenshot-3.png?rev=2662301","caption":"No widget settings - just add and save!"}],"raw_content":"<!--section=description-->\n<p>Expanding Archives adds a widget that shows your old posts in an expandable\/collapsible format. Each post is categorized under its year and month, so you can expand all the posts in a given month and year.<\/p>\n\n<p>This plugin comes with very minimal CSS styling so you can easily customize it to match your design.<\/p>\n\n<p>JavaScript is required. No IE support.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload <code>expanding-archives<\/code> to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Go to Appearance -&gt; Widgets and drag the Expanding Archives widget into your sidebar.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id='how%20can%20i%20change%20the%20appearance%20of%20the%20widget%3F'><h3>How can I change the appearance of the widget?<\/h3><\/dt>\n<dd><p>The plugin does not come with a settings panel so you have to do this with your own custom CSS. Here are a few examples:<\/p>\n\n<p>Change the year background colour:<\/p>\n\n<pre><code>.expanding-archives-title {\n    background: #000000;\n}\n<\/code><\/pre>\n\n<p>Change the year font colour:<\/p>\n\n<pre><code>.expanding-archives-title a {\n    color: #ffffff;\n}\n<\/code><\/pre><\/dd>\n<dt id='how%20can%20i%20limit%20the%20results%20to%20a%20specific%20category%3F'><h3>How can I limit the results to a specific category?<\/h3><\/dt>\n<dd><p>By default, the widget includes posts in all categories. You can add the following code to a custom plugin or a child theme's functions.php file to limit the results to posts in a specific category:<\/p>\n\n<pre><code>add_filter('expanding_archives_get_posts', function(array $args) {\n     $args['cat'] = 2; \/\/ Replace with ID of your category.\n\n     return $args;\n });\n\n add_filter('expanding_archives_query', function(string $query) {\n     $category = get_category(2); \/\/ Replace with ID of your category.\n     if (! $category instanceof \\WP_Term) {\n         return $query;\n     }\n\n     global $wpdb;\n\n     return \"\n SELECT DISTINCT MONTH(post_date) AS month, YEAR(post_date) AS year, COUNT(id) as post_count\n FROM {$wpdb-&gt;posts}\n          INNER JOIN {$wpdb-&gt;term_relationships} ON ({$wpdb-&gt;posts}.ID = {$wpdb-&gt;term_relationships}.object_id AND {$wpdb-&gt;term_relationships}.term_taxonomy_id = 2)\n WHERE post_status = 'publish'\n   AND post_date &lt;= now()\n   AND post_type = 'post'\n GROUP BY month, year\n ORDER BY post_date DESC\n     \";\n });\n<\/code><\/pre>\n\n<p>Be sure to set the ID of your category in both of the designated places (the examples use ID <code>2<\/code>).<\/p>\n\n<p>Note that the results may not update instantly, as the query to retrieve the date periods is cached for one day. To force the query to re-run, delete this transient: <code>expanding_archives_months<\/code><\/p><\/dd>\n<dt id='how%20can%20i%20specify%20a%20cut-off%20date%3F'><h3>How can I specify a cut-off date?<\/h3><\/dt>\n<dd><p>By default, the widget will show a list of every year you've published posts.<\/p>\n\n<p>If you have a lot of posts, you may wish to only show results from the last few years. This can be done with the following code snippet:<\/p>\n\n<pre><code>add_filter('expanding-archives\/earliest-date', fn() =&gt; '-4 years');\n<\/code><\/pre>\n\n<p>You can change <code>-4 years<\/code> to any value supported by <a href=\"https:\/\/www.php.net\/manual\/en\/datetime.construct.php\">the PHP DateTime constructor<\/a>. This can be a relative value (as shown above), or a specific date like:<\/p>\n\n<pre><code>add_filter('expanding-archives\/earliest-date', fn() =&gt; '2023-01-01');\n<\/code><\/pre>\n\n<p>Note that the results may not update instantly, as the query to retrieve the date periods is cached for one day. To force the query to re-run, delete this transient: <code>expanding_archives_months<\/code><\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>2.1.0 - 23 March 2024<\/h4>\n\n<ul>\n<li>New: Added support (via a filter) for specifying a cut-off date. See readme FAQ for details.<\/li>\n<\/ul>\n\n<h4>2.0.2 - 3 February, 2022<\/h4>\n\n<ul>\n<li>Refactor: Posts are now retrieved via a custom REST API endpoint, instead of the default. This allows developers to more easily filter the query arguments for retrieving posts.<\/li>\n<\/ul>\n\n<h4>2.0.1 - 31 January, 2022<\/h4>\n\n<ul>\n<li>Fix: Only showing a max of 10 posts in a month. Now it will show up to 100.<\/li>\n<\/ul>\n\n<h4>2.0 - 23 January, 2022<\/h4>\n\n<ul>\n<li>Dev: Plugin has been rewritten (should be backwards compatible).<\/li>\n<li>Dev: Removed jQuery dependency (and dropped IE support).<\/li>\n<li>Dev: Remove Font Awesome spinner in favour of vanilla CSS.<\/li>\n<li>Fix: Invalid HTML when the site has no posts.<\/li>\n<\/ul>\n\n<h4>1.1.1<\/h4>\n\n<ul>\n<li>Added filters that allow developers to easily modify the archive list.<\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>Added a new option in the widget where you can choose to auto expand the current month or not.<\/li>\n<\/ul>\n\n<h4>1.0.5<\/h4>\n\n<ul>\n<li>Use transient for database query that fetches all the months.<\/li>\n<\/ul>\n\n<h4>1.0.4<\/h4>\n\n<ul>\n<li>Added <code>xhrFields: { withCredentials: true }<\/code> to ajax call.<\/li>\n<\/ul>\n\n<h4>1.0.3<\/h4>\n\n<ul>\n<li>Changed the month URLs to use get_month_link() instead of building them manually.<\/li>\n<li>Tested the plugin with WordPress 4.4 beta.<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Tested with WordPress version 4.3.<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Month names are now displayed using date_i18n() instead of date() so they will translate.<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial release.<\/li>\n<\/ul>","raw_excerpt":"This plugin adds a new widget where you can view your old posts by expanding certain years and months.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/eo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/37032","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/eo.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/eo.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=37032"}],"author":[{"embeddable":true,"href":"https:\/\/eo.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/nosegraze"}],"wp:attachment":[{"href":"https:\/\/eo.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=37032"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/eo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=37032"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/eo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=37032"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/eo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=37032"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/eo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=37032"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/eo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=37032"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}