ID, 'large' );
if ( $thumb ) {
$content = '
 . ')
' . $content;
}
return $content;
}
/**
* カテゴリーリストの件数をの中に移動 & spanで囲む
*/
add_action( 'wp_list_categories', __NAMESPACE__ . '\hook_wp_list_categories' );
function hook_wp_list_categories( $output ) {
$output = str_replace( ' (', '(', $output );
$output = str_replace( ')', ')', $output );
// $output = preg_replace( '/<\/a>\s*\((\d+)\)/', ' ($1)', $output );
// サブメニューがある場合( )、トグルボタンを追加
$output = preg_replace(
'/<\/a>([^<]*) )、トグルボタンを追加
*/
add_action( 'wp_list_pages', __NAMESPACE__ . '\hook_wp_list_pages' );
function hook_wp_list_pages( $output ) {
$output = preg_replace(
'/<\/a>([^<]*)の中に置換
*/
add_action( 'get_archives_link', __NAMESPACE__ . '\hook_get_archives_link', 10, 6 );
function hook_get_archives_link( $link_html, $url, $text, $format, $before, $after ) {
if ( 'html' === $format ) {
$link_html = '- ' . $before . '' . $text . '' . $after . '
';
}
return $link_html;
}
/**
* カテゴリーチェック時、順番をそのままに保つ
*/
add_action( 'wp_terms_checklist_args', __NAMESPACE__ . '\hook_terms_checklist_args', 10 );
function hook_terms_checklist_args( $args ) {
$args['checked_ontop'] = false;
return $args;
}
/**
* ページネーションの構造を書き換える
*/
add_filter( 'navigation_markup_template', __NAMESPACE__ . '\hook_navigation_markup', 10, 2 );
function hook_navigation_markup( $template, $class ) {
if ( 'pagination' === $class ) {
return '';
}
return $template;
}