توضیحات
After activating the plugin, you will have two new template tags at your disposal:
<?php previous_archive_link( 'format', 'link' ); ?>
<?php next_archive_link( 'format', 'link' ); ?>
They adapt their output depending on whether the date archive is a day, a month,
or a year, and they will only output a link for an adjacent time period in which you
have published posts. Both tags take two string parameters, format and link.
The format parameter defines what comes before and after the link. In it, %link
will be replaced with whatever is declared in the link parameter below. previous_archive_link
defaults to “« %link
” and next_archive_link
defaults to “%link »
“.
The link parameter defines the link text. Both tags default to “%date
“, the
adjacent archive page’s localized date.
If you’re interested in contributing to the code behind this plugin, it’s also hosted on GitHub:
https://github.com/justincwatt/wp-adjacent-archive-links
عکسهای صفحه
نصب
- Extract the zip file, drop the contents in your wp-content/plugins/ directory, and then activate from the Plugins page.
- Edit your theme file (e.g. archive.php) and add the template tags
<?php previous_archive_link(); ?>
and<?php next_archive_link(); ?>
سوالات متداول
- How do I make my date archives show all posts for that time period in chronological order, rather than just 10 at a time?
-
Just add
query_posts($query_string . '&showposts=1000&order=asc');
to the archive.php template right under the header call.
نقد و بررسیها
نقد و بررسیای برای این افزونه یافت نشد.
توسعه دهندگان و همکاران
“Adjacent Archive Links” نرم افزار متن باز است. افراد زیر در این افزونه مشارکت کردهاند.
مشارکت کنندگانترجمه “Adjacent Archive Links” به زبان شما.
علاقه مند به توسعه هستید؟
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
گزارش تغییرات
3.0
- Fixed issue where date strings were appearing non-localized (in en_US only)
- Added Spanish localization (Hat tip: Andrew Kurtis of WebHostingHub)
2.0
- Fixed use of wpdb->prepare for WordPress v3.5 (Hat tip: Jonathan Patt)
- Improved output of custom previous/next archive hrefs (Hat tip: Trevor Morris)
- Added the ability to apply filters to the output of both functions (Hat tip: Trevor Morris)
1.0
- Initial version