run script if page ==
Permalink
Hi looking for a bit of help trying to run a simple script / bit of jquery if the page is == home using this code
I'm not quite sure of my syntax and keep getting errors.
Any help appreciated.
thanks
<?php $page = Page::getCurrentPage(); $pageid = $page->getCollectionID(); if ($pageid == home) {echo '<script> $(document).ready(function(){ $('#logo').fadeIn(4000); });</script>'; } ?>
I'm not quite sure of my syntax and keep getting errors.
Any help appreciated.
thanks
home is a page handle.
The php syntax error is because 'home' needs to be quoted, But you should either put a number there, or get the page handle.