スタイルシートで対応しているので、そのプラグインは試していませんがカテゴリーが日本語を含んでいるってことはないでしょうか。
スラッグを英数表記にすると良いかもしれません。
ryouma さん
質問内容とそれますが、トピックスのタイトルが消えてしまっていました。
(表示できるよう、こちらで短いものに変更しました)
お手数ですが、
– 消える前に入れていたタイトル(覚えている範囲でもかまいません)
– 何か気づいたこと
を教えていただけますか。よろしくお願いします。
いずれにしても、テーマ側でカテゴリー出力時に工夫が必要です。
案1
Advanced Custom Fields plugin プラグインを使って、カテゴリーの管理画面にカラーピッカーのカスタムフィールドを加える
http://www.advancedcustomfields.com
案2
自作でカテゴリーの管理画面にカラーピッカーをつける
(前にブログ書きました)
http://gatespace.jp/2012/09/28/add-extra-fields-for-category/
ただし、最新版で検証していないので、そのままで使える保証は出来ません。
Takano様、失礼致しました。
タイトルはこのままで大丈夫です☆
こちらのページでLIG紹介されているプラグイン。カテゴリにアイコンを設定できるそうです。こちらの使用を検討しておりますが、使えるか心配です。
gatespaceさま、ありがとう御座います。是非試させて頂きます。
こんばんは。
gatespace様、リンク先拝見させて頂きました。まさに理想通りのプラグインです!
ただ、知識不足でどのようにテンプレートファイルに記述すれば良いか分かりませんでした。
恐縮ですが、例えば以下のコード(Twenty Twelve)にはどのように記述すれば良いでしょうか。自分なりにやってみましたがさっぱり分かりませんでした。。
<?php get_header(); ?>
<div id="primary" class="site-content">
<div id="content" role="main">
<?php if ( have_posts() ) : ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>
<?php twentytwelve_content_nav( 'nav-below' ); ?>
<?php else : ?>
<article id="post-0" class="post no-results not-found">
<?php if ( current_user_can( 'edit_posts' ) ) :
// Show a different message to a logged-in user who can add posts.
?>
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'No posts to display', 'twentytwelve' ); ?></h1>
</header>
<div class="entry-content">
<p><?php printf( __( 'Ready to publish your first post? <a href="%s">Get started here</a>.', 'twentytwelve' ), admin_url( 'post-new.php' ) ); ?></p>
</div><!-- .entry-content -->
<?php else :
// Show the default message to everyone else.
?>
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' ); ?></h1>
</header>
<div class="entry-content">
<p><?php _e( 'Apologies, but no results were found. Perhaps searching will help find a related post.', 'twentytwelve' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
<?php endif; // end current_user_can() check ?>
</article><!-- #post-0 -->
<?php endif; // end have_posts() check ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
お忙しい中、申し訳ありませんが、お教え頂けると大変助かります。宜しくお願い致します。
Twenty Twelveであれば contentなんとか.phpあたりで
カテゴリーを表示したい場所で
$cats = get_the_category();
if ( $cats && ! is_wp_error( $cats ) ) : // 取得できたら
foreach ( $cats as $cat ) { // 配列で戻ってきているのでループを回す
$term_data = get_option('term_'.intval($cat->term_id));
$term_bgcolor = ( empty( $term_data['bgcolor'] ) ) ? '#666' : $term_data['bgcolor'];
$term_txcolor = ( empty( $term_data['textcolor'] ) ) ? '#fff' : $term_data['textcolor'];
echo '<a style="background-color: '.esc_attr($term_bgcolor).'; color: '.esc_attr($term_txcolor).';" href="'.get_term_link( $cat ).'">'.$cat->name."</a> ";
}
endif;
と書くだけです。まずはやってみてはどうですか?
位置やcssなどはお好みで調整してください。
gatespace様、ありがとうございます。gatespace様のプラグインで無事に設置する事ができました。とても助かりました。
いくら探しても見つからなかったので、本当に助かりました!
ありがとうございました。