Код: Выделить всё
/// Register fonts.
Wp_register_style('font-awesome', get_stylesheet_uri(), [], filemtime get_template_directory_uri().'/fonts/font-awesome-webfont.woff', [], false, 'all');
wp_register_style('Naskh', get_stylesheet_uri(), [], filemtime get_template_directory_uri().'/fonts/naskh-webfont.woff', [], false, 'all');
wp_register_style('Roboto', get_stylesheet_uri(), [], filemtime, get_template_directory_uri().'/fonts/roboto-webfont.woff', [], false, 'all');`
`/// Enqueue Fonts.
wp_enqueue_style('font-awesome-webfont.woff');
wp_enqueue_style('naskh-webfont.woff');
wp_enqueue_style('roboto-webfont.woff');`
and in the css i add it like this
`--arabic-fonts:src='\\fonts\\naskh-webfont.woff';
--english-fonts:src='\\fonts\\roboto-webfont.woff';`
`[dir="rtl"] .container {font-family:var(--arabic-fonts);}
[dir="ltr"] .container {font-family:var(--english-fonts);}`
Я попробовал Google, но не нашел никакого возможного решения.
вот ошибка, которую я получил и извините
Неустранимая ошибка: необнаруженная ошибка: неопределенная константа «filemtime» в C:\xampp\htdocs\MyWebSite \wp-content\themes\Copper\functions.php:16 Трассировка стека: #0 C:\xampp\htdocs\MyWebSite\wp-includes\class-wp-hook.php(324):
copper_enqueue_scripts('')
#1 C:\xampp\htdocs\MyWebSite\wp-includes\class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#2 C:\xampp\htdocs\MyWebSite\wp-includes\plugin.php(517): WP_Hook->do_action(Array)
#3 C:\xampp \htdocs\MyWebSite\wp-includes\script-loader.php(2265): do_action('wp_enqueue_scri...')
#4 C:\xampp\htdocs\MyWebSite\wp-includes\ class-wp-hook.php(324): wp_enqueue_scripts('')
#5 C:\xampp\htdocs\MyWebSite\wp-includes\class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#6 C:\xampp\htdocs\MyWebSite\wp-includes\plugin.php(517): WP_Hook->do_action(Array)
#7 C:\xampp\htdocs\MyWebSite\wp-includes\general-template.php(3050): do_action('wp_head')
#8 C:\xampp\htdocs \MyWebSite\wp-content\themes\Copper\header.php(13): wp_head()
#9 C:\xampp\htdocs\MyWebSite\wp-includes\template.php(810) : require_once('C:\xampp\htdocs...')
#10 C:\xampp\htdocs\MyWebSite\wp-includes\template.php(745): load_template('C: \xampp\htdocs...', true, Array)
#11 C:\xampp\htdocs\MyWebSite\wp-includes\general-template.php(48): location_template(Array, true , true, Array)
#12 C:\xampp\htdocs\MyWebSite\wp-content\themes\Copper\index.php(7): get_header()
#13 C:\xampp\htdocs\MyWebSite\wp-includes\template-loader.php(106): include('C:\xampp\htdocs...')
#14 C: \xampp\htdocs\MyWebSite\wp-blog-header.php(19): require_once('C:\xampp\htdocs...')
#15 C:\xampp\htdocs\MyWebSite \index.php(17): require('C:\xampp\htdocs...')
#16 {main}, добавленный в C:\xampp\htdocs\MyWebSite\wp-content\ themes\Copper\functions.php в строке 16
На этом сайте произошла критическая ошибка.
и проблема в том, что VS Code в редакторе не отображается никаких ошибок
Подробнее здесь: https://stackoverflow.com/questions/784 ... nction-php
Мобильная версия