在Wordpress 3.0中的自定义post_type永久链接中使用日期 [英] Using Dates in Custom post_type Permalinks in Wordpress 3.0

查看:168
本文介绍了在Wordpress 3.0中的自定义post_type永久链接中使用日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  /% post_type%/%year%/%monthnum%/%postname%/ 

我无法弄清楚如何添加日期标签。使用这个代码,给我 / my_type / example-post-slug /

  register_post_type('customtype',array(
... other options ...
'rewrite'=> array('slug'=>'my_type'),
));

如何添加日期?

解决方案

您可以使用插件自定义帖子类型固定链接。只需安装插件,并在设置中更改固定链接格式。


I'm adding a custom post_type to Wordpress, and would like the permalink structure to look like this:

/%post_type%/%year%/%monthnum%/%postname%/

I can't figure out how to add the date tags. Using this code, gives me /my_type/example-post-slug/:

register_post_type( 'customtype', array(
    ...other options...
    'rewrite' => array('slug' => 'my_type'),
));

How do I include the dates?

解决方案

You can achieve this with the plugin Custom Post Type Permalinks. Just install the plugin and change the permalink format in the settings.

这篇关于在Wordpress 3.0中的自定义post_type永久链接中使用日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆