Different CSS on homepage -
i have code in stylesheet:
#social-icons { width:100%; } #social-icons li { float:right; display: inline; list-style-type:none; padding: 10px 10px 10px 10px; width:50px; height:50px; text-decoration: none; } i #social-icons li float:left on pages, except homepage.
in theme's header.php file, before </head> tag, put code :
<?php if(!is_homepage()) { ?> <style type="text/css"> #social-icons li {float:left} </style> <?php } ?> if don't want touch theme, can use wp_head action hook.
after bruno toffolo's comment
if don't inline css, can put homepage-specific css rules css file homepage.css , enqueue css file is_homepage() conditional tag.
<?php if(!is_homepage()) { wp_enqueue_style(...); } ?>
Comments
Post a Comment