我正在使用getarchives_where钩子来过滤和显示自定义帖子类型的档案。
add_filter( 'getarchives_where' , 'getarchives_where_filter' );
function getarchives_where_filter( $where , $r ) {
$post_type = 'blog-posts';
return str_replace( "post_type = 'post'" , "post_type = '$post_type'" , $where );
}
它大体上是有效的--它显示“2011年11月”(我只有一个11月的自定义帖子),但到2011年11月的链接仍然链接到一般帖子的档案。
而不是example.com/blog-post/2011/11,它会将我发送到example.com/2011/11
我该如何解决这个问题呢?
我应该提一下,我重新保存了我的固定链接,这对解决问题没有任何帮助。
任何帮助都将不胜感激。
谢谢
发布于 2011-11-29 22:27:03
我想通了。我不得不重新保存我的固定链接,并用Wordpress给我的代码更新.htaccess文件。
https://stackoverflow.com/questions/8085016
复制相似问题