Site logo

Archived topic

What is rtl in child theme's functions.php

5 replies · Started by Gerard on April 7, 2020

Viewing posts 1–6 of 6
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 );

What is this for in the child theme? Is it necessary?

I got the child theme from here: https://docs.generatepress.com/article/using-child-theme/

As it is in there, I assume it's necessary, but I have seen GP's child themes from other developers not including that.

Hi there,

That's a function specifically used for RTL language. You can remove that if you are not using a RTL language.

Let me know if this helps :)

Hi Leo,

Isn't this function already included in the parent theme? Why is it necessary in the child theme?

Thanks Leo!

No problem :)

This archived topic is closed to new replies.