We recommend a WordPress archive plug-in: Wp-easyarchives.
WP-easyarchives displays a search engine-friendly tree structure archive list on the custom page. Unlike other archive plug-ins, the time and author filtering functions are added.
Installation Method:
1. decompress the compressed package to the {WordPress root directory}/WP-content/plugins/
2. log on to your WordPress background and go to the Plugins page to activate the plug-in WP-easyarchives.
3. append the following code to the appropriate location of the topic file:<?php wp_easyarchives(); ?>
Parameters used:
Name |
Type |
Description |
Default Value |
Supported versions |
Limit |
Integer |
Display the number of archives per month (only valid for widgets) |
6 |
1.0 or more |
Mode |
Last/All/None |
Display Mode |
Last |
1.0 or more |
Page |
True/false |
Show page entries |
False |
1.0 or more |
You can use the preceding parameter to change the display mode of the latest comment, for example:
<? PHP wp_easyarchives ('mode = last & page = false');?> This is the latest article published in January. The page is not displayed)
Added question about the archive link:
Since my permanent link is/archives/Hangzhou post_id).html, the corresponding monthly archive address is:/archives/data/% year %/% monthnum % /. The plug-in's corresponding monthly archive address:/% year %/% monthnum % /.
Therefore, you need
$url = get_bloginfo('url') .'/' . $month_item->year . '/' . zeroise($month_item->month,2);
The code is changed:
$url = get_bloginfo('url') .'/'. 'archives' . '/'. 'date' . '/' .$month_item->year . '/' . zeroise($month_item->month,2);
Hope to help me meet friends with the same problems.
Link to the original article: WordPress plug-in recommendation: Wp-easyarchives and monthly archive links