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

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -