• Resolved dantasimport

    (@dantasimport)


    I got this php error : PHP Warning: include(): Failed opening ‘wp-content/themes/flatsome/assets/css/ie-fallback.css’ for inclusion (include_path=’.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php’) in /home/rs3ckhw/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(582) : eval()’d code on line 4

    Can someone tell me what this means and how to fix it

    Thank you Danny

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    This error come from a snippet you’ve added to your site, not from the Code Snippets plugin itself. It’s not something we can fix on our end, but if you’re able to identify the snippet causing the issue and post them here, I’d be happy to suggest some fixes.

    You should be able to narrow down to specific snippets with this search:

    include @line:4

    Thread Starter dantasimport

    (@dantasimport)

    Thanks for your reply

    If i search this comes up :

    add_action(‘wp_head’, ‘inject_flatsomeiefallback’, 5);
    function inject_flatsomeiefallback() {
    ob_start();
    include ‘wp-content/themes/flatsome/assets/css/ie-fallback.css’;
    $atf_css = ob_get_clean();
    if ($atf_css != “” ) {
    echo ”;
    }
    }

    add_action(‘wp_enqueue_scripts’, ‘remove_flatsomeiefallback’, 101);
    function remove_flatsomeiefallback() {
    wp_dequeue_style( ‘ie-fallback’ );
    wp_deregister_style( ‘ie-fallback’ );
    }

    Could this be it where the error comes from

    Danny

    Plugin Author Shea Bunge

    (@bungeshea)

    Hi @dantasimport,

    Looks like that could be the issue! Unfortunately, it looks like the snippet you posted is a little malformed – I’ve tried to fix it up as best as I can.

    The key part is using WP_CONTENT_DIR when attempting to find the path to the theme folder:

    add_action( 'wp_head', function () {
    ob_start();
    include WP_CONTENT_DIR . '/themes/flatsome/assets/css/ie-fallback.css';
    $atf_css = ob_get_clean();
    if ( $atf_css !== '' ) {
    echo '<style>' . $atf_css . '</style>';
    }
    }, 5 );

    add_action( 'wp_enqueue_scripts', function () {
    wp_dequeue_style( 'ie-fallback' );
    wp_deregister_style( 'ie-fallback' );
    }, 101 );
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.