Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Load the style sheet from the parent theme.
- *
- */
- function theme_name_parent_styles() {
- // Register the parent stylesheet
- wp_register_style( 'theme-name-parent-style', get_template_directory_uri() . '/style.css', array(), '0.1', 'all' );
- // Register the parent rtl stylesheet
- if ( is_rtl() ) {
- wp_register_style( 'theme-name-parent-style-rtl', get_template_directory_uri() . '/rtl.css', array(), '0.1', 'all' );
- }
- // Enqueue the style
- wp_enqueue_style( 'theme-name-parent-style' );
- wp_enqueue_style( 'theme-name-parent-style-rtl' );
- }
- add_action( 'wp_enqueue_scripts', 'theme_name_parent_styles' );
- ?>
- <?php
- /**
- * Load the style sheet from the parent theme with current version number in the url.
- *
- */
- function theme_name_parent_styles() {
- // Define Parent theme
- $theme = wp_get_theme( 'theme-name' );
- // Register the parent stylesheet
- wp_register_style( 'theme-name-parent-style', get_template_directory_uri() . '/style.css', array(), $theme['Version'], 'all' );
- // Register the parent rtl stylesheet
- if ( is_rtl() ) {
- wp_register_style( 'theme-name-parent-style-rtl', get_template_directory_uri() . '/rtl.css', array(), $theme['Version'], 'all' );
- }
- // Enqueue the style
- wp_enqueue_style( 'theme-name-parent-style' );
- wp_enqueue_style( 'theme-name-parent-style-rtl' );
- }
- add_action( 'wp_enqueue_scripts', 'theme_name_parent_styles' );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement