• I′m developing a plugin and I have some extra styles that I want to use to override some of the main styles for the plugin, but only when javascript is disabled. Is that possible?

Viewing 2 replies - 1 through 2 (of 2 total)
  • You could put your css styles in a noscript tag?

    <noscript>
    <style>
    body {
    background-color: linen;
    }

    h1 {
    color: maroon;
    margin-left: 40px;
    }
    </style>
    </noscript>

    Thread Starter lisa_westlund

    (@lisa_westlund)

    That will probably work, but I need to do it from the php file where I enqueue my styles, so that it will work for anyone who installs my plugin, not just me.

    Part of my code:

    function add_styles_and_scripts() {
    		wp_enqueue_style( 'wplw_style', plugins_url('/css/wplw_style.css', __FILE__) );
    	 	wp_enqueue_style( 'wplw_noscript_style', plugins_url('/css/wplw_noscript_style.css', __FILE__) );
    		wp_enqueue_script( 'wplw_gallery_js', plugins_url('lisawestlund-instagram-portfolio/js/wplw_gallery.js'));
    	}

    What I need to do is to get the second style in the code above into a noscript tag, and I can′t figure that part out ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Plugin: Add styles when javascript is disabled’ is closed to new replies.