Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a bunch of html i need to show only if it is a homepage. My theme pulls content from AJAX and then changes the URL to reflect the new content change. in the meantime, the homepage content (the entirety of which is contained in the footer) still remains below, what i need to happen is the footer content should still be there but the content under
<?php if ( is_home() ) { ?> disappears. there is a close button included on each page, when it's clicked the AJAX content is removed and the page returns to the homepage, i need the is_home content to come back at this point. What happens right now is that the content does not go away when the url chnages, and when the ajax content is removed and the page scrolls back to the homepage area and the url goes back to home, i simply get the background no content. My entire footer file can be found here: http://pastebin.com/Xpjc0vrG (the issue begins at line 46. ). The actual site is HERE: http://onthemouse.com/. the content i need gone when not in home is the grey stuff under the carousel you can see the custom.js file here http://pastebin.com/i4cQRS27, this file handles all the ajax requests, but i'm not sure which part actually pulls the page content. i added code on limnes 261 and 594 to try and make this work, hasnt so far. I think the url chnage and ajax content starts at LINE 236.

share|improve this question
1  
This is really a javascript issue and not specific to WordPress. give your home content in #work-detail-wrapper a different id and amend the javascript function that loads content to hide/show this div. right now it's getting overwritten when new content is loaded. –  Milo Jul 29 '12 at 18:42
    
i'll try that. thanks. –  theatomicdude Jul 29 '12 at 21:41

1 Answer 1

You need to is is_front_page() instead of is_home().

is_home() actually refers to the blog page (or the home page if you have it set to show latest posts).

is_front_page() refers to the page (regardless of whether it is a static page or a latest posts feed) that sits on the front of your site.

share|improve this answer
    
didn't make a different, i made the edit, the behavior is the same. –  theatomicdude Jul 29 '12 at 21:40
    
Can you please show us the complete code? –  Pippin Jul 29 '12 at 23:25
    
the full code as in header.php too? because the full footer.php in included here pastebin.com/Xpjc0vrG. but i think its most likely what Milo mentioned it looks like AJAX is overwriting the content, but this is supposed to work nevertheless.. –  theatomicdude Jul 30 '12 at 0:42
    
Can you show us the code that performs the ajax request? –  Pippin Jul 30 '12 at 1:37
    
you can see the custom.js file here pastebin.com, this file handles all the ajax requests, but i'm not sure which part actually pulls the page content. i added code on limnes 261 and 594 to try and make this work, hasnt so far. –  theatomicdude Jul 30 '12 at 2:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.