@michael001dylan002 さん
作者です。
WordPress 4.4 あたりから wp_get_archives
がカスタム投稿タイプに対応したんですが、その際に、?post_type がつくようになりました。互換性などの問題もあるので、ここら辺の仕様を変更する予定は今のところ無いです。
というわけで、 WordPress get_archives_link
へのフィルターフックを活用すると、URLのパラメーターを除去することができます。以下に例を載せますので参考になればと思います。
<?php
/**
* Remove post_type args from archive url
*
* @param string $link_html
* @param string $url
* @param string $text
* @param string $format
* @param string $before
* @param string $after
*/
function remove_post_type_arg_from_get_archives_link( $link_html, $url, $text, $format, $before, $after ) {
$url = esc_url( remove_query_arg( 'post_type', $url ) );
if ( $format == 'link' ) {
$link_html = "\t<link rel='archives' title='" . esc_attr( $text ) . "' href='$url' />\n";
} elseif ( $format == 'option' ) {
$link_html = "\t<option value='$url'>$before $text $after</option>\n";
} elseif ( $format == 'html' ) {
$link_html = "\t<li>$before<a href='$url'>$text</a>$after</li>\n";
} else {
$link_html = "\t$before<a href='$url'>$text</a>$after\n";
}
return $link_html;
}
add_filter( 'get_archives_link', 'remove_post_type_arg_from_get_archives_link', 10, 6 );