Different header in firefox
-
Hello! Thank you so much for taking the time to read my post. Any help you’re able to offer would be greatly appreciated ??
I need to have a different header appear in firefox than in all other browsers for my site.I currently have this code in my header:
<head> <script src="https://use.fontawesome.com/d450b61818.js"></script> <meta charset="<?php bloginfo( 'charset' ); ?>"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="profile" href="https://gmpg.org/xfn/11"> <?php if ( is_singular() && pings_open( get_queried_object() ) ) : ?> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> <?php endif; ?> <?php wp_head(); ?> <?php echo do_shortcode( "[hmenu id=2]" ); ?> <div class="top-bar"> <div class="top-countdown"> <a href="https://calvarytucson.com/teaching-archives/live/"> <button class="top-countdown-button"><div class="top-countdown-button-inner"><span class="firefox-live"><?php echo do_shortcode( '[widget id="smartcountdown-2"]' ); ?></span></div></button> </a> </div> <div class="top-icons"> <a href="https://twitter.com/calvarytucson" target="_blank"> <button class="top-icons-button"><div class="top-icons-button-inner"><img src="https://calvarytucson.com/wp-content/uploads/2017/07/social-003_twitter-2.png" alt="Twitter"></div></button> </a> </div> <div class="top-icons"> <a href="https://www.facebook.com/calvarychapeltucson" target="_blank"> <button class="top-icons-button"><div class="top-icons-button-inner"><img src="https://calvarytucson.com/wp-content/uploads/2017/07/social-006_facebook-2.png" alt="Facebook"></div></button> </a> </div> <div class="top-icons"> <a href="https://www.instagram.com/calvarytucson/?hl=en" target="_blank"> <button class="top-icons-button"><div class="top-icons-button-inner"><img src="https://calvarytucson.com/wp-content/uploads/2017/07/social-038_instagram-2.png" alt="Instagram"></div></button> </a> </div> </div> </head>
and it seems line the code:
<?php echo do_shortcode( '[widget id="smartcountdown-2"]' ); ?>
found on line 14 is causing the body of our site to be blank in firefox.I haven’t been able to find a work around that allows me to insert that shortcode without the php, or in a way that doesn’t break the site in firefox.
So, I’m settling for having 2 different header files; one that pulls up in firefox, and one that pulls up for every other browser.
This is the code that I’ve come up with so far, but I am pretty new to the code side of wordpress:
if(strlen(strstr($agent,"Firefox")) > 0 ){ $browser = 'firefox'; } if($browser=='firefox'){ get_header( 'one' ); } else{ get_header(); }
and I have a file titled “header-one.php” where my header.php file is located with all the same code, but with text instead of the shortcode php.
Is that correct? and is there a way to add that to my functions.php file to make that work, or do I need to go into all the places where my site calls for the header and replace it with that bit of code?
Thank you again, very much!
Chris Furrow
- The topic ‘Different header in firefox’ is closed to new replies.