Community Forums › Forums › Archived Forums › General Discussion › is_home or is_front_page on Landscape Theme
Tagged: conditional tags
- This topic has 8 replies, 2 voices, and was last updated 10 years, 5 months ago by brace1.
-
AuthorPosts
-
November 23, 2013 at 10:03 am #75215brace1Member
Hello,
I am having problems with some conditional tags. I cannot get is_home or is_front_page to work on the landscape theme. I just get nothing.
Site is here:
http://www.dinesupportgroup.com
Thoughts? I've tried a couple things to no success, but basically, conditional tags appear to do nothing for my site..
~Joe
http://www.dinesupportgroup.comNovember 23, 2013 at 10:44 am #75235nutsandboltsMemberWhat's the whole function you're using?
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 23, 2013 at 10:49 am #75239brace1Memberif (is_home()) { add_action( 'genesis_after_header', 'genesis_do_nav' ); remove_action( 'genesis_before_header', 'genesis_do_nav' ); }
Appears on all pages.
November 23, 2013 at 10:53 am #75240nutsandboltsMemberI'm confused - it's working for me. On the homepage, the nav has been moved under the header. On all other pages, the nav is above the header. That's exactly what that function is asking the site to do.
What is the outcome you want? Maybe your function needs a little tweaking to produce some other result.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 23, 2013 at 11:13 am #75244brace1MemberI've done this 100x before.
For the home page, I'd like to have what it says. Move the nav above the header.
For all other pages, I'd like it to be regular. I'll probably end up hiding it completely.It is as if the engine is just ignoring the conditional.
~Joe
November 23, 2013 at 11:18 am #75245nutsandboltsMemberEdit: I'm a dork. I cannot distinguish between "above" and "below" today. Hang on.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 23, 2013 at 11:26 am #75249brace1MemberWait, my fault. Switch them.
I want the nav above the header.
November 23, 2013 at 11:33 am #75253nutsandboltsMemberSo you want it to display just like it is on the interior pages, but after the image? And you want the interior pages to be the opposite of what they are right now? Just making sure I'm understanding.
If so, try changing the conditional to
if (!is_home()) {
- by the crazy logic going on, that should theoretically reverse them if that's the goal.What function did you use to move the header and nav to the bottom of the homepage? I'm wondering if they're conflicting with each other.
Also, this may be the dumbest suggestion ever, but have you tried swapping the calls so the remove_action is first? Sometimes that has made a difference for me with other functions.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 23, 2013 at 12:46 pm #75259brace1MemberNo, that doesn't do it. I seemingly can't put anything against whether the home page is_home.
Landscape is different from many genesis themes because of it's use of home.php. They have a #homepage id being called and the code looks like this:
<?php get_header(); ?> <?php genesis_home(); ?> <div id="homepage"> <?php if( function_exists('wp_cycle') ) : ?> <?php wp_cycle(); ?> <?php endif; ?> </div> <?php get_footer(); ?>
Is there a loop being called at all on the Landscape home page? That would explain it, though I don't know how to fix.
~Joe
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.