• Resolved Doodlebee

    (@doodlebee)


    This is truly an oddball question, and I know I could easily find the answer – the problem is, to do what I need to do to easily find the answer would require me to do something that I am currently not allowed to do.

    Wow…say that 5 times really fast!

    Criminy…okay, here’s the thing. I’m currently working on a “WordPress-as-a-CMS” site. I have a whole bunch of Pages that are all nice and pretty, and I’m using the Fold Page List plugin to make the sidebar even prettier. That sucker has been well-hacked to get it to do exactly what I need it to do, but now I’m to a point where I need a little something extra.

    There’s *one* link that is “hard coded” into the sidebar – it’s for the contact page. I need the style of that page to be slightly different than the rest of the site. Now, this page is totally separate from wWordpress – it’s my own contact form that the person requested to be used. I managed (witht he forum help here) to get the header, sidebar and footer to be called in to that page succesfully. However, I need to add an “if ( is_home() ) statement so that the rest of the site has the links styled the one way, and and “else” to make the contact form display the alternate.

    It’s not working. When I put in the conditional tag, the home page and contact page always show the same thing. (currently, there is also an “if (is_page() )” conditional as well, for all the inside pages).

    I’m wondering if the resason is because, although WordPress is currently in the root of the website, it’s not technically “home”. See, the guy I’m doing this for already has a site up on his server, and it’s run with HTML. He’s just recently decided to swap it to dynamic. The plus in all this was that the server wasn’t configured to “see” PHP index files – so I’ve been happily coding away on the root of his server, but no one can see it unless they type in the “index.php” specifically. Now, in teh configuration of the Options in the admin panel, I have the “Blog URL” set as http://sitename.com/index.php” – so the guy can click through and see how everything is linking up and all that. When the site “goes live”, then I’ll be removing his HTML files (which will force the server to display the index.php file as default) *and* changing the “Blog URL” in options to just “http://sitename.com”

    Now, because of the way it’s set up *now*, I’m wondering if this is why the “if ( is_home() )” isn’t working, and once the site “goes live”, then it will. Or, because I have it set in the options to have the “index.php” as part of the base options, should it not already be recognizing the current (unseeable) home page as “home”, and therefore the conditional should work anyway?

    I *could* take down the dude’s index.html page and see if the “home” conditional will then function – but he’d kill me, as he does not want this to go live (not even a peek!) at all until the site is completely finished. So I was hoping someone here could reassure me that, yes, when the site goes live, the “home” conditional will work.

    If it won’t (because it *should* be now), then is there another reason why the conditional doesn’t work on the home page?

Viewing 2 replies - 1 through 2 (of 2 total)
  • I think it is related to the setup:
    1. The two URIs should never end in a filename only a directory name!
    2. If there is an index.html in WP’s root directory, many things don’t work properly because some functions are looking for the “index” of the directory… so they find the .html and got crazy 🙂

    (In cases like this I build it in a subdir and when it’s done I move it up)

    Thread Starter Doodlebee

    (@doodlebee)

    Good! Thank you moshu – that’s just what I needed 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘if ( is_home() ) doesn’t work’ is closed to new replies.