adredz Posted November 30, 2009 Share Posted November 30, 2009 I've googled it but the results didn't satisfy me. I wan't to make a php condition block that puts a background to a division when the current page is not the home page. My css code is within an external file and it has a block of code as follows: #page { background-image: url('images/page_background.png'); background-repeat: repeat-y; width: 900px; height: 700px; } In my_file.php I have this condition: <?php if (!(is_page('home_page))) { ?> How do I call #page from here? <?php } ?> Quote Link to comment https://forums.phpfreaks.com/topic/183355-css-inside-php-condition/ Share on other sites More sharing options...
mikesta707 Posted November 30, 2009 Share Posted November 30, 2009 you can give your body tag a unique id. like body id="unique"> in your case you would probably want to change the id to "page" Quote Link to comment https://forums.phpfreaks.com/topic/183355-css-inside-php-condition/#findComment-967805 Share on other sites More sharing options...
adredz Posted November 30, 2009 Author Share Posted November 30, 2009 you can give your body tag a unique id. like body id="unique"> in your case you would probably want to change the id to "page" Yeah I know... Pls refer back to my post, I have edited it to make my point clear... Quote Link to comment https://forums.phpfreaks.com/topic/183355-css-inside-php-condition/#findComment-967810 Share on other sites More sharing options...
mikesta707 Posted November 30, 2009 Share Posted November 30, 2009 Oh, sorry. You could use that condition to decide whether or not to give the body tag an id. IE <body <?php if (!(is_page('home_page'))) { echo 'id="page" '; } ?> > <!-- rest of page --> Quote Link to comment https://forums.phpfreaks.com/topic/183355-css-inside-php-condition/#findComment-967813 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.