• Resolved tiffdotc

    (@tiffdotc)


    I’m working on a site that another developer set up. The site is built on the Twenty Twelve theme. The previous developer created a custom header for the homepage (located in a new header_home.php file), and the rest of the site sticks to the basic Twenty Twelve header style (in a headerdefault.php file).

    I need to create a separate header for the homepage on a mobile device. I need to do this because the custom header_home is not mobile friendly – it takes up a ton of space. And when I try to overwrite it with css media query, it doesn’t work.

    The mobile homepage header needs to have the header image from header_home, but the navigation from the headerdefault template to show up underneath it. So, I’ve created a new file called header_mobile.php that lays everything out the way I need it. When I try to incorporate this new header_mobile.php in the header.php file, though, I get an error message. Here’s the code I have:

    <?php

    if (($width <= 600) && (is_page(‘home’)))
    {
    include(TEMPLATEPATH.’/header_mobile.php’);
    }

    elseif (($width >= 600) && (is_page(‘home’))){
    include(TEMPLATEPATH.’/header_home.php’);
    }

    else {
    include(TEMPLATEPATH.’/headerdefault.php’);
    }
    ?>

    When this code is used, I get “failed to open stream: No such file or directory”

    Any thoughts on what I’m missing? The site is raisingdigitalnatives.com.

  • The topic ‘Need custom header for mobile’ is closed to new replies.