WordPress.org

Ready to get started?Download WordPress

Forums

UK Cookie Consent
Cookie consent bar is visible on printed pages, so I tweaked it a bit… (1 post)

  1. LMPogoda
    Member
    Posted 3 months ago #

    Hello,

    I like Cookie Consent a lot, but I found recently CSS styles, which control display of the “cookie consent bar” are set for “screen” media only.

    So I tweaked source code a bit like this:

    function catapult_add_cookie_css() {
    /* some lines omitted */
    	echo '
    		<style type="text/css"> // CSS now apply to all the media

    Now, if someone needs too style screen warning and print version, she/he can do it in child styles like this:

    // let’s target screens
    		@media screen {
    			/* necessary CSS */
    		}
    
    		// in print we simply may not want the cookie consent at all, styled or not.
    		@media print {
    			#catapult-cookie-bar {
    				display: none;
    			}
    		}
    		</style>';

    I’m posting it here with a hope you’ll include change like this is never revisions, so I won’t need to tweak the plugin each time you update it… :)

    https://wordpress.org/plugins/uk-cookie-consent/

Reply

You must log in to post.

About this Plugin

About this Topic

Tags