![]() |
Help with PHP if-then.. Hey all I'm trying to display seperate body classes for the home page and the inner pages. I have written this into my index.php <body class="<?php if (page-id-5){ echo "body-home"; } else { echo "body-other"; } ?>"> It does work for the front page (page-id-5), but it just puts in "body-home" on the inner pages as well. Any ideas? Kind regards |
Re: Help with PHP if-then.. The trouble is that if (page-id-5) isn't a proper statement, so it always returns true. Assuming that you're using Wordpress, the is_page() function oughtta do the trick. Code: if (is_page('5')){-Ryan |
Re: Help with PHP if-then.. Quote:
Thank you that did the trick :) |
| All times are GMT -6. The time now is 10:38 PM. |