Title: rgba background
Last modified: March 11, 2024

---

# rgba background

 *  [Insect Trojan](https://wordpress.org/support/users/insecttrojan/)
 * (@insecttrojan)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/rgba-background/)
 * hello i write the code with this line to work the background color any other 
   solutions ? and still sometimes it not prints the code to the html in some pages
   not to all ? i have mention this bug many many times in here and with mail to
   your support please help me
 *     ```wp-block-code
           // convert rgb color to hex
           $bg_rgb_color = $this->hex2rgb( $options['colors']['bar'] );
   
           // invalid color? use default
           if ( $bg_rgb_color === false )
               $bg_rgb_color = $this->hex2rgb( $cn->defaults['general']['colors']['bar'] );
   
           // allow rgba background
           echo str_replace( '__CN_BG_COLOR__', esc_attr( 'rgba(' . implode( ',', $bg_rgb_color ) . ',' . ( (int) $options['colors']['bar_opacity'] ) * 0.01 . ');' ), $output );
   
           add_filter( 'safe_style_css', [ $this, 'allow_style_attributes' ] );
   
           $output = apply_filters( 'cn_cookie_notice_output', wp_kses_post( $output ), $options );
   
           remove_filter( 'safe_style_css', [ $this, 'allow_style_attributes' ] );
   
       }
       ```
   
    -  This topic was modified 2 years, 3 months ago by [Insect Trojan](https://wordpress.org/support/users/insecttrojan/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Frgba-background%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Thread Starter [Insect Trojan](https://wordpress.org/support/users/insecttrojan/)
 * (@insecttrojan)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/rgba-background/#post-17489701)
 * so it must prints this on html
 * `<script id="iva-love-js-extra">var ivaLove={"ajaxurl":"https:\/\/www.insect.
   gr\/wp-admin\/admin-ajax.php"};</script> <script async id="cookie-notice-front-
   js-before">var cnArgs={"ajaxUrl":"https:\/\/www.insect.gr\/wp-admin\/admin-ajax.
   php","nonce":"392f23d0b3","hideEffect":"fade","position":"bottom","onScroll":
   true,"onScrollOffset":120,"onClick":false,"cookieName":"cookie_notice_accepted","
   cookieTime":2592000,"cookieTimeRejected":2592000,"globalCookie":false,"redirection":
   false,"cache":true,"revokeCookies":false,"revokeCookiesOpt":"automatic"};</script
   > <div id="cookie-notice" role="dialog" class="cookie-notice-hidden cookie-revoke-
   hidden cn-position-bottom" aria-label="Cookie Notice" style="background-color:
   rgba(50,50,58,0.98);"><div class="cookie-notice-container" style="color: #fff"
   ><span id="cn-notice-text" class="cn-text-container">Χρησιμοποιούμε cookies για
   να σας προσφέρουμε την καλύτερη δυνατή εμπειρία στη ιστοσελίδα μας.</span><span
   id="cn-notice-buttons" class="cn-buttons-container"><a href="#" id="cn-accept-
   cookie" data-cookie-set="accept" class="cn-set-cookie cn-button" aria-label="
   Εντάξει" style="background-color: #f7ca18">Εντάξει</a></span><span id="cn-close-
   notice" data-cookie-set="accept" class="cn-close-icon" title="Όχι"></span></div
   ></div> <script defer src="https://www.insect.gr/wp-content/cache/autoptimize/
   js/autoptimize_f5e0a3e74e35874696e3580ddb1aaf15.js"></script>`
 * but it prints this sometimes on some pages without the code of the cookie notice
   plugin
 * `script id="iva-love-js-extra">var ivaLove={"ajaxurl":"https:\/\/www.insect.gr\/
   wp-admin\/admin-ajax.php"};</script> <script defer src="https://www.insect.gr/
   wp-content/cache/autoptimize/js/autoptimize_198d5fd4f4728b9ace4e027d3ae7c5e8.
   js"></script>`
    -  This reply was modified 2 years, 3 months ago by [Insect Trojan](https://wordpress.org/support/users/insecttrojan/).

Viewing 1 replies (of 1 total)

The topic ‘rgba background’ is closed to new replies.

 * ![](https://ps.w.org/cookie-notice/assets/icon-256x256.png?rev=3549327)
 * [Compliance by Hu-manity.co](https://wordpress.org/plugins/cookie-notice/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cookie-notice/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cookie-notice/)
 * [Active Topics](https://wordpress.org/support/plugin/cookie-notice/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cookie-notice/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cookie-notice/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [Insect Trojan](https://wordpress.org/support/users/insecttrojan/)
 * Last activity: [2 years, 3 months ago](https://wordpress.org/support/topic/rgba-background/#post-17489701)
 * Status: not resolved