[support] Testing for arg() OR is_front
Chris McCreery
chris.mccreery at gmail.com
Mon Jul 12 12:29:17 UTC 2010
That was the problem. I need the ! statement at the beginning of both
conditions. So in the end the following did the trick:
<?php if (!(arg(1) == '39' || arg(1) == '49')): ?>
<div> Content </div>
<?php endif; ?>
Thank you so much for all your help everyone.
On Mon, Jul 12, 2010 at 8:17 AM, Earnie Boyd
<earnie at users.sourceforge.net>wrote:
> Chris McCreery wrote:
> > Right now I have this:
> >
> > <?php if (arg(1) != '39'): ?>
> > <div> Content </div>
> > <?php endif; ?>
> >
> > This works just fine but when i try to add in a second arg(1) and OR
> > statement it doesn't work. Any ideas?
> >
>
> I made this mistake often when I first started programming. Use AND and
> not OR when using !=. Or you could use the alternative method as show
> below.
>
> <?php if (arg(1) != '39' && arg(1) != '49'): ?>
> <div> Content </div>
> <?php endif; ?>
>
> ALTERNATIVE:
>
> <?php if (!(arg(1) == '39' || arg(1) == '49')): ?>
> <div> Content </div>
> <?php endif; ?>
>
> --
> Earnie
> -- http://progw.com
> -- http://www.for-my-kids.com
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>
--
Chris McCreery
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20100712/6ce3b5a8/attachment.html
More information about the support
mailing list