Archived topic
Error in console "Refused to apply style from..etc"
3 replies · Started by Atef on October 25, 2020
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.
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 :)
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.
Hi there,
you can find the child theme here:
https://docs.generatepress.com/article/using-child-theme/#installing-a-child-theme