Linux 软件免费装

Archives for Custom Post Types

开发者 jacklenox
更新时间 2018年5月24日 22:02
PHP版本: 3.1 及以上
WordPress版本: 4.3
版权: GPL2
版权网址: 版权信息

标签

custom post types archives

下载

1.0 1.0.1 1.0.2

详情介绍:

DEPRECATION NOTICE: As of WordPress 4.4, you no longer need this plugin as wp_get_archives() now accepts custom post types as an argument. See #34686. This plugin provides proper support for archived pages of custom post types to match the support for normal posts. The problem is that the function, wp_get_archives() does not allow you to pass in a post type. It only works for normal posts. There is a filter called getarchives_where() but this doesn't handle the archive URLs (e.g. http://yoursite.com/2014/). So while the filter will help you view the correct archives, it won't work properly in conjunction with the wp_get_archives() function. For example, a link to "June 2014" emitted by wp_get_archives() will only take you to normal posts from June 2014, not custom post types. This plugin provides a new function: wp_get_archives_cpt(). This function can take a post_type argument as well as the usual arguments that can be passed to wp_get_archives(). The plugin also provides automatic handling for custom post type archive URLs. This plugin has stemmed from a ticket that I have been working on in core: https://core.trac.wordpress.org/ticket/21596 Unfortunately a proper patch for this in core will probably have to go quite deep. I have therefore decided to share this plugin as a temporary solution.

安装:

  1. Upload archives-for-custom-post-types.php to the /wp-content/plugins/ directory
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Place <?php wp_get_archives_cpt( 'post_type=custom_post_type' ); ?> in your templates

更新日志:

1.0.2 1.0.1 1.0