PDA

View Full Version : Can I use PHP in Style??


Jhonnyf
01-26-2008, 10:37 AM
I make this code
<?php
if ((date('D', strtotime('+2 hours')) == 'Sat') or (date('D', strtotime('+2 hours')) == 'Sun'))
{
?>
$module_style
<?php
}
else
{
header ("Location: another.php");
};
?>

I try to do a conditional when if is Saturday or Sunday execute that module, else, redirect to another page

I Think that php not work in style U_U

Opserty
01-26-2008, 11:53 AM
You can't put PHP into a template. Templates are HTML (and if conditions) only. You must place PHP code in a Plugin with an appropriate hook location.