• Hi, my website is http://www.kaltfitness.com.

    I had recently set up some conditional headers and footers for specific pages of my site in header.php and footer.pho. Everything was going well, but I noticed that the menu on my mobile site was no longer showing up. As such, I went into the website and tried to delete some of the recent changes that I had made to header.php and footer.php. However, in doing so, I must have done something wrong, as the entire site then went down. I am not sure what happened, but I do know the specific lines of code that I had edited. Perhaps something looks off with them that you can identify?

    From header.php:

    <!-- start conditional header -->
    <?php if( !is_page( '2906' ))?>
    <?php endif; ?>
    	<?php if ( !is_front_page() && ( !is_page( '2906' ))?>
    	<?php get_template_part( 'framework/inc/page-top' ); ?>
    <?php endif; ?>

    From footer.php

    <!-- start conditional footer -->
    <?php if( !is_page( '2906' ))?>

    I didn’t actually edit anything else in header.php or footer.php before the site went down.

    Thanks in advance for your assistance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Hi there adamj8!

    Are you able to access your PHP error logs? If you don’t know where those reside, you can ask your hosting company about that. What you could also do is rename the theme’s folder so that WordPress will fallback to Twenty Sixteen or Fifteen and then you could install your theme from a fresh, clean copy.

    Hope that helps!

    1. Enable Default theme
    2. Install maintenance mode plugin and enable it
    3. Then open your theme file, This is simple syntax error go through your code and count how much { (open braces) and } (close braces)

    Hi,

    In the code snippet above, I have just noticed one minor syntax error, I believe if you try & make a minor change then probably your issue would be addressed at an instance.

    In header.php code in following statement just add one more closing round bracket “)”, because by mistake I think a closing bracket would have been missed out. And hence the error has occurred.
    So simply change:
    <?php if ( !is_front_page() && ( !is_page( '2906' ))?>
    to
    <?php if ( !is_front_page() && ( !is_page( '2906' )))?>

    Also check entire header, footer & other modified files if all curly braces “{}” & round brackets “()” are properly closed.

    Hope this solves your issue & your site works fine again.

    Thanks.

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

The topic ‘Editing header.php and footer.php and Site Crashed’ is closed to new replies.