cocoonの記事一覧ページ(カテゴリーページ)で、サムネイルの上に小さく出るカテゴリー名のバッジの色を変えたい!
カテゴリーによって色分けされているブログもよくありますよね。
なんだかおしゃれだったので真似したくなりやってみました。
バッジの色を変える方法を説明します。記述はコピペでOK!
では行ってみましょう!
【cocoon】カテゴリー名の背景色をカテゴリーごとに変える方法
以下の記述を外観→テーマエディターのスタイルシートに書き足せばOKです。
.cat-label-● {background-color: #ffffff;}
「ffffff」の部分にお好みの色のカラーコードを当てはめて下さい。
部分●の部分には数字が入るのですが、数字はカテゴリーIDとなっています。
カテゴリーにはそれぞれ番号が不規則に割り振られるので、その番号を確認して●の部分に入れる必要があります。
カテゴリーIDの確認方法は以下の通り。
①投稿→カテゴリーへ移動
②カテゴリー名にマウスを乗せる
この時画面下のリンク先URLの部分に出てくる「category&tag_ID=●」という部分の
●の数字が、カテゴリーIDです。
この数字を、先ほどのCSSの●の部分に当てはめます。
あとはお好みのカラー指定をすれば、カテゴリーバッジの色が代わります!
仕組みがわかれば簡単ですね!
cocoon設定からは出来るのか?
最初はcocoon設定から出来るのかなーと思って色々見てたのですが、
それらしき項目が見つかりませんでした。
カテゴリーのIDはランダムで指定されるのでそう簡単に出来ないのでしょうか。
こうして自分でいじってみると、複雑さがよくわかりますね。
cocoonのようにカスタマイズしやすいテーマを作ってくれた方に本当に感謝です…。
まとめ:【cocoon】カテゴリーバッジの色はカテゴリーIDごとに設定できる
ブログのテーマでcocoonを使っている人は多いと思います。
あなたのブログのデザイン性を上げるために役に立てば嬉しいです!
それにしても、カテゴリーごとにID番号が割り当てられるのは理解できますが、なんでランダムなんでしょう?
謎だ〜。
コメント
order lipitor atorvastatin 20mg price order lipitor 20mg generic
order cipro 500mg pill – cheap amoxiclav buy clavulanate generic
buy baycip online – buy cephalexin 500mg sale clavulanate over the counter
buy metronidazole without prescription – order azithromycin pills buy generic azithromycin over the counter
buy ciplox 500 mg without prescription – order ciprofloxacin 500mg online erythromycin 500mg price
buy valtrex generic – buy nemasole order zovirax 400mg generic
ivermectin 12mg oral – order ciplox 500 mg online cheap tetracycline 250mg for sale
furosemide pill – lasix uk order captopril 25mg generic
glycomet ca – order cipro online buy lincomycin cheap
zidovudine 300mg tablet – order generic allopurinol buy allopurinol 100mg generic
clozaril sale – buy perindopril 8mg famotidine usa
quetiapine tablet – order venlafaxine 75mg online eskalith oral
anafranil 50mg cheap – order anafranil 50mg online cost doxepin 75mg
order hydroxyzine 10mg online – brand buspar 10mg buy endep without prescription
clavulanate oral – myambutol 600mg sale buy ciprofloxacin cheap
amoxicillin for sale – buy amoxicillin sale cipro online order
purchase zithromax without prescription – oral tindamax generic ciplox 500 mg
clindamycin price – cleocin 150mg without prescription buy chloromycetin generic
stromectol otc – how to buy cefaclor purchase cefaclor sale
purchase albuterol inhalator online – generic phenergan theo-24 Cr price
medrol 16 mg over counter – buy fml-forte online order generic azelastine
buy desloratadine generic – purchase beclomethasone sale buy ventolin 2mg inhaler
glyburide 2.5mg cheap – order glyburide for sale forxiga 10mg pill
glucophage 500mg cheap – glycomet 1000mg price buy generic precose over the counter
order repaglinide online – prandin 2mg for sale jardiance 25mg generic
terbinafine us – cost lamisil buy griseofulvin without prescription
buy generic semaglutide for sale – glucovance without prescription buy DDAVP without a prescription
buy ketoconazole without a prescription – nizoral over the counter order generic itraconazole 100mg
famvir 500mg oral – buy famciclovir without a prescription where to buy valcivir without a prescription