Skip to content

Instantly share code, notes, and snippets.

@theimageyard
Created February 17, 2018 19:25
Show Gist options
  • Save theimageyard/4ae147e2c9754b5d7ca2c12fe50ce591 to your computer and use it in GitHub Desktop.
Save theimageyard/4ae147e2c9754b5d7ca2c12fe50ce591 to your computer and use it in GitHub Desktop.
Add Javascript Warning
add_action( 'wp_footer', 'add_noscript_warning' );
function add_noscript_warning () { ?>
<noscript>
<div style="
font-family: sans-serif;
position: fixed;
bottom: 0;
left: 0;
width: 100%;
z-index: 999999;
text-align: center;
font-weight: bold;
font-size: 18px;
color: #FFF;
background-color: #e7475d;
padding: 8px 0 9px;
letter-spacing: 1px;
border-top: 35px solid white;
">
THIS WEBSITE WORKS BEST WITH JAVASCRIPT ENABLED
</div>
<style>
#root-translate,
.simplefavorite-button,
.secondary-navigation .menu-favorites-item {
display: none !important;
}
</style>
</noscript>
<? }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment