Site logo

Archived topic

what does this code do? I got it from Tom

4 replies · Started by albabes on April 3, 2019

Viewing posts 1–5 of 5

/**
 * I forget what this does?
 
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 );
*/

It adds the RTL stylesheet if you're using an RTL language. If not, you can remove the function.

Its in by default?

It is. It checks whether it's an RTL site, if it is, it will enqueue the rtl.css file in GeneratePress. For some reason, WordPress doesn't do this by default if a child theme is active.

You can go ahead and remove the function if you have no need for the file :)

Thanks Tom. So glad to see u having much success!

This archived topic is closed to new replies.