WordPress.org

Forums

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

  1. LMPogoda
    Member
    Posted 1 year 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/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • UK Cookie Consent
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags