Я пытался настроить CSS дочерней темы.
Если я изменю style.css дочерней темы, она будет закомментирована на устройствах iOS.
Затем я попытался поставить новую таблицу стилей в очередь, и в результате эта таблица стилей вообще не отображается в разделе head (всегда на iOS, настольная версия работает как шарм).
Это мой код для постановки таблицы стилей в очередь:
function wp_enqueue_styles() {
$handle = 'custom_style';
$path = get_stylesheet_directory_uri() . '/css/';
$directory = get_stylesheet_directory() . '/css/';
$dependencies = [];
$version = '1.0';
$filename = 'main.css';
$filename_min = 'main.min.css';
if ( file_exists( $directory . $filename_min ) ) {
wp_register_style( $handle, $path . $filename_min );
wp_enqueue_style( $handle, $path . $filename_min, $dependencies, $version );
} else if ( file_exists( $directory . $filename ) ) {
// override version with file changed time to bypass cache problems
wp_register_style( $handle, $path . $filename );
wp_enqueue_style( $handle, $path . $filename, $dependencies, $version );
}
}
Любая идея?





Попробуй это
function theme_name_scripts() {
// Remove a CSS file (main theme)
wp_deregister_style( 'Script_name_id' );
// Add New a CSS file ( child theme )
wp_enqueue_style( 'Script_name_id', get_template_directory_uri() . 'Script_path',[],null);
}
add_action( 'wp_enqueue_scripts', 'theme_name_scripts' );