Re: Question on conditional statement



Tim Roberts wrote:
rbaulbin@xxxxxxxxxxx wrote:
If anyone could field the following question, I'd greatly appreciate
it:

This seems to be a simple question, but for some reason it's not
working in the code I'm working with...
I'm very new to PHP...

I'd like to simply test whether or not the current web page is the
home page, and then execute one line of code, such as <div
class=class1>; if not, execute <div class=class2>. I've tried various
incarnations of is_home(), but the page displays nothing. Can anyone
shoot me some code that will work? :)

What, precisely, do you mean by "home page"? In my view, a "home page" is
the default page for a site, so you'd just put your line of code in
"index.php".

I think he means the home page for the browser, not the site.
.



Relevant Pages

  • Re: Question on conditional statement
    ... This seems to be a simple question, but for some reason it's not ... incarnations of is_home, ... shoot me some code that will work? ... Tim Roberts, timr@xxxxxxxxx ...
    (comp.lang.php)
  • Re: Question on conditional statement
    ... This seems to be a simple question, but for some reason it's not ... home page, and then execute one line of code, such as <div ... incarnations of is_home, ... shoot me some code that will work? ...
    (comp.lang.php)
  • Question on conditional statement
    ... This seems to be a simple question, but for some reason it's not ... home page, and then execute one line of code, such as <div ... incarnations of is_home, ... shoot me some code that will work? ...
    (comp.lang.php)
  • Re: Torture - A lawful good act?
    ... son did not shoot. ...  He was shot to death with five different rifles. ... a CCL is because you want to protect your life, your family, your ... The reason to have it is to defend ...
    (rec.games.frp.dnd)
  • Re: British Trident programme dead?
    ... You can't shoot an unproofed gun in the UK, ... Sounds like you'd have to reproof a firearm to use a new powder? ... If you shoot a modern firearm using bulleted cartridges the firearm is marked by the proof house with the type of cartridge it fires, ... from everyone else on the planet, for some reason. ...
    (sci.military.naval)