• Resolved jleung1994

    (@jleung1994)


    I tried to override the arrow color with the following code, but the style was not in the <head> or <header> section.
    I do not want to manually set the CSS for every slider in the Admin.

    function my_inline_styles_method()
    {
    if (is_singular('gallery')) {
    wp_enqueue_style('custom-inline-style', get_template_directory_uri() . '/style.css');
    
    $custom_css = ".sp-previous-arrow::after, .sp-previous-arrow::before,
    .sp-next-arrow::after, .sp-next-arrow::before {
    background: rgba(155,155,155,0.8)!important;
    }";
    wp_add_inline_style('custom-inline-style', $custom_css);
    }
    
    }
    add_action('wp_enqueue_scripts', 'my_inline_styles_method', 999);
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Cannot override CSS style’ is closed to new replies.