WPの「外観」→「メニュー」機能で生成されたメニューの疑似クラス、要素の何番目かを指定するには。。
【HTML】
<!–フッターナビ SNS–>
< div id=”footer-navigation-social-contents”>
< ?php wp_nav_menu(array(‘theme_location’ => ‘footer-navigation-social-contents’)); ?>
< /div>
< !–フッターナビ SNS end–>
【CSS】
#footer-navigation-social-contents ul li.menu-item:first-child {
background:url(./images/icon_facebook.png);
background-size:cover;
}
#footer-navigation-social-contents ul li.menu-item:nth-child(2n) {
background:url(./images/icon_twitter.png);
background-size:100%;
}
【テーマの為の関数】
register_nav_menus(array(
‘global-contents’ => ‘グローバルコンテンツ’,
‘footer-navigation-shop-location’ => ‘フッターナビゲーション 店舗一覧’,
‘footer-navigation-social-contents’ => ‘フッターナビゲーション SNS’
));
2017年6月22日木曜日
登録:
投稿 (Atom)