• Resolved ImageMatteo

    (@theoshold)


    Hello,

    I installed thw code snippet plugin and I would like to migrate all customized css, from theme additional css to code snippet plugin, but when I do copy/past into code snippet plugin new snippet I obtain a fatal error.

    .ign-wl-modal {
    z-index: 99999 !important;
    }
    /* Links */

    #main a { color: #3d9cd2; }
    .woocommerce #content input.button.alt:hover, .woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover, .woocommerce-page #content input.button.alt:hover, .woocommerce-page #respond input#submit.alt:hover, .woocommerce-page a.button.alt:hover, .woocommerce-page button.button.alt:hover, .woocommerce-page input.button.alt:hover {

    background:#3d9cd2 !important;

    background-color:#3d9cd2 !important;

    color:white !important;

    text-shadow: transparent !important;

    box-shadow: none;

    border-color:#3d9cd2 !important;

    }

    .woocommerce #content input.button:hover, .woocommerce #respond input#submit:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover, .woocommerce-page #content input.button:hover, .woocommerce-page #respond input#submit:hover, .woocommerce-page a.button:hover, .woocommerce-page button.button:hover, .woocommerce-page input.button:hover {

    background:#3d9cd2 !important;

    background-color:#3d9cd2 !important;

    color:white !important;

    text-shadow: transparent !important;

    box-shadow: none;

    border-color:#3d9cd2 !important;

    }

    .woocommerce #content input.button, .woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button, .woocommerce-page #content input.button, .woocommerce-page #respond input#submit, .woocommerce-page a.button, .woocommerce-page button.button, .woocommerce-page input.button {

    background: #3d9cd2 !important;

    color:white !important;

    text-shadow: transparent !important;

    border-color:#3d9cd2 !important;

    }

    .woocommerce #content input.button.alt:hover, .woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover, .woocommerce-page #content input.button.alt:hover, .woocommerce-page #respond input#submit.alt:hover, .woocommerce-page a.button.alt:hover, .woocommerce-page button.button.alt:hover, .woocommerce-page input.button.alt:hover {

    background: #3d9cd2 !important;

    box-shadow: none;

    text-shadow: transparent !important;

    color:white !important;

    border-color:#3d9cd2 !important;

    }
    .woocommerce-pagination .page-numbers .current, .woocommerce-pagination .page-numbers li a:hover {
    padding: 8px 10px !important;
    background: #3D9CD2 !important;
    color: #fff !important;
    }
    .woocommerce-checkout #payment div.payment_box {
    background: white !important;
    color: black !important;
    }
    .woocommerce-checkout #payment {
    background: white !important;
    }
    .woocommerce-checkout #payment ul.payment_methods {
    border-bottom: 0px solid white !important;
    }

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author ImageShea Bunge

    (@bungeshea)

    You can’t paste CSS directly into a new snippet – it’s expecting PHP code.

    Instead, you need to wrap it in some PHP:

    add_action( 'wp_head', function () { ?>
    <style>
    
    /* your CSS code goes here */
    
    </style>
    <?php } );

    Version 3.0 pro will include native support for CSS code, but currently wrapping in PHP is the best solution.

    Thread Starter ImageMatteo

    (@theoshold)

    thank you, so I tried with this code that works on my css theme:

    .wc-block-grid__products .wc-block-grid__product .wp-block-button__link, .added_to_cart {
    background-color: #3d9cd2 !important;
    border-color: #3d9cd2 !important;
    color: white !important;
    text-decoration: none !important;
    }
    .wp-block-button__link:not(.has-background):hover, .wp-block-button__link:not(.has-background):focus, .wp-block-button__link:not(.has-background):active {
    border-color: #3d9cd2 !important;
    background-color: #3d9cd2 !important;
    text-decoration: none !important;
    }

    And I added this code:

    add_action( ‘wp_head’, function () { ?>
    <style>

    .wc-block-grid__products .wc-block-grid__product .wp-block-button__link, .added_to_cart {
    background-color: #3d9cd2 !important;
    border-color: #3d9cd2 !important;
    color: white !important;
    text-decoration: none !important;
    }
    .wp-block-button__link:not(.has-background):hover, .wp-block-button__link:not(.has-background):focus, .wp-block-button__link:not(.has-background):active {
    border-color: #3d9cd2 !important;
    background-color: #3d9cd2 !important;
    text-decoration: none !important;
    }

    </style>
    <?php } )

    But the results is fatal error πŸ™

    Plugin Author ImageShea Bunge

    (@bungeshea)

    You’re missing a ; on the last line of your code.

    It should be:

    <?php } );

    Thread Starter ImageMatteo

    (@theoshold)

    it’s true, thank you very much

    Plugin Author ImageShea Bunge

    (@bungeshea)

    Glad to hear it’s working.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘fatal error when I copy paste css’ is closed to new replies.