1function my_getarchives_where( $where, $args ){
2 $taxonomy = get_query_var('taxonomy');
3 $term = get_query_var('term');
45?><pre><?php6var_dump($taxonomy);7var_dump($term);8?></pre><?php910if(!empty($taxonomy)){11$where=$where." AND t.taxonomy = '".$taxonomy."'";12}13if(!empty($term)){14$where=$where." AND terms.slug = '".$term."'";15}1617?><pre><?php18var_dump($where);19?></pre><?php2021return$where;22}23add_filter('getarchives_where','my_getarchives_where',10,2);2425functionmy_getarchives_join($join,$args){26global$wpdb;2728$join=" LEFT JOIN $wpdb->term_relationships as r ON $wpdb->posts.ID = r.object_ID
29 LEFT JOIN $wpdb->term_taxonomy as t ON r.term_taxonomy_id = t.term_taxonomy_id
30 LEFT JOIN $wpdb->terms as terms ON t.term_id = terms.term_id";3132?><pre><?php33var_dump($join);34?></pre><?php3536return$join;37}38add_filter('getarchives_join','my_getarchives_join',10,2);3940functionmy_year_link($url,$year){4142$taxonomy=get_query_var('taxonomy');43$term=get_query_var('term');4445?><pre><?php46var_dump($taxonomy);47var_dump($term);48?></pre><?php4950if(!empty($taxonomy)){51$url=add_query_arg('taxonomy',$taxonomy,$url);52}53if(!empty($term)){54$url=add_query_arg('term',$term,$url);55}5657?><pre><?php58var_dump($url);59?></pre><?php6061return$url;62}63add_filter('year_link','my_year_link',10,2);
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/02/08 08:34 編集
2017/02/09 00:05