Como una adición a la otra respuesta por @ m0r7if3r:
Puedes usar current_theme_supports()
para cargar solo la hoja de estilo de los temas principales si hay soporte para el tema.
function add_supported_stylesheets()
{
if ( current_theme_supports( 'parent-stylesheet' ) )
wp_enqueue_style( 'main', get_stylesheet_directory_uri().'/style.css', array(), filemtime( get_stylesheet_directory().'/style.css' );
}
// In your parent themes bootstrap in the functions.php file
// Add the theme support:
add_theme_support( 'parent-stylesheet' );
// Then add the stylesheet:
add_action( 'after_setup_theme', 'add_supported_stylesheets', 20 );
Tenga en cuenta que esta función agrega filemtime
en la versión-nr. para evitar el almacenamiento en caché del navegador si se cambiaran los contenidos de los archivos.
Esto permitirá a los usuarios deshabilitar la hoja de estilo en el bootstrap de temas secundarios con una simple llamada fn:
remove_theme_support( 'parent-stylesheet' );
// ...or...
add_theme_support( 'parent-stylesheet' );