Include CSS, JS etc by Page

doc

@vark:
Some of the hits mentioned by Bramus could be found by using the advanced forum search and keywords: CSS page_id

Regards Christian

vark

Hi Bramus,
Sorry to have recapitulated something already posted.  Could you point me towards the other post?  Thanks.

Bramus

Thanks for posting, but i think this has already been posted here a few times only for a different header, a simple edit by that script would have done the same as you posted here, so you could save a month of work by searching a bit or asking for help :P

Btw can you place the code in the code tag?
BRAMUS Internet Services

vark

I'm a complete neophyte when it comes to php, so it took me months to figure this out.  For those who haven't got this already, here's a solution:

<?php if (PAGE_ID  ==  '2') { ?>
    <link href="<?php echo WB_URL; ?>/styles/home.css" rel="stylesheet" type="text/css" media="screen" />

<?php } else if (PAGE_ID  ==  '3') { ?>
    <link href="<?php echo WB_URL; ?>/styles/page2.css" rel="stylesheet" type="text/css" media="screen" />
   
<?php } else  $list = array('4', '5', '6');
              if (in_array (PAGE_ID, $list)) { ?>
    <link href="<?php echo WB_URL; ?>/styles/pages4to6.css" rel="stylesheet" type="text/css" media="screen" />

<?php } ?>

Page_id can be found in the web address of a given page during an edit session in WB admin (http://yourpage.org/admin/pages/modify.php?page_id=2).