php - if home css for wordpress -
css conditioning if user in homepage of wordpress?
i put this
<?php if(is_home()) { echo '<link rel="stylesheet" href="customhome.css">' } ?>
into page editor , did applied css. because it's using echo there bug. echo out thing
> echo ' ‘ } ?>
in end of post.
i want know else should include that? tried put in header doesn't work.
you can append css using wp_enqueue_scripts like;
function custom_css() { if (is_home()) { wp_enqueue_style( 'custom_style_name', 'path_to_your_css' ); } } add_action( 'wp_enqueue_scripts', 'custom_css' );
put above code block functions.php
Comments
Post a Comment