[Support request] Error in console “Refused to apply style from..etc”

Home Forums Support [Support request] Error in console “Refused to apply style from..etc”

Home Forums Support Error in console “Refused to apply style from..etc”

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1504069
    Atef

    Hi,
    After the theme updates that happened about a week ago, I started noticing that the following error appears in the browser console.
    Just wondring if this is theme related and how to fix it?

    (index):1 Refused to apply style from ‘https://coptic-treasures.com/wp-content/themes/generatepress/rtl.css?ver=5.5.1’ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.

    I use a child theme which calls up the main theme’s rlt css file. However, I see now that the main theme does not have a css file called “rtl.css”.
    So what shall I do?

    Here is the code in the child theme’s function.php file:

    
    function generatepress_child_enqueue_scripts() {
    	if ( is_rtl() ) {
    		wp_enqueue_style( 'generatepress-rtl', trailingslashit( get_template_directory_uri() ) . 'rtl.css' );
    		
    	}
    }
    add_action( 'wp_enqueue_scripts', 'generatepress_child_enqueue_scripts', 100 );
    

    a sample post that you can check:
    https://coptic-treasures.com/book/38-shepherd-accourding-to-my-heart/

    thanks in advance.

    #1505103
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You can actually completely remove that function as of GeneratePress 3.0.

    We’ve updated the official child theme so it no longer has it as well.

    Let me know if you need more info 🙂

    #1506139
    Atef

    Hi Tom,
    Thanks a lot. removing this code solved the problem.
    I am just wondering where can I get the updated official child theme?
    I did a search in the documentation, but found only the old version.
    thanks.

    #1506243
    David
    Staff
    Customer Support
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.