I have 2 pages and each of them has its own cap. 2 different caps I can call using <?php get_header('2'); ?> <?php get_header('2'); ?> and I will call header-2.php in this way. And inside this file in the tag I call <?php wp_head(); ?> <?php wp_head(); ?> . And he uploads styles for header.php . That's what I have in function.php
function elkino_scripts() { wp_enqueue_style( 'style', get_template_directory_uri() . '/css/style.css' ); wp_enqueue_script( 'header', get_template_directory_uri() . '/js/header.js', array(), null, true ); wp_enqueue_script( 'yandex-map-api', 'https://api-maps.yandex.ru/2.1/?lang=ru_RU', array(), null, true ); wp_enqueue_script( 'util-calculate-area-min', get_template_directory_uri() . '/js/util.calculateArea.min.js', array(), null, true ); wp_enqueue_script( 'polylabel-min', get_template_directory_uri() . '/js/polylabel.min.js', array(), null, true ); wp_enqueue_script( 'newmap', get_template_directory_uri() . '/js/newmap.js', array(), null, true ); } add_action( 'wp_enqueue_scripts', 'elkino_scripts' ); So that is what I actually can not figure out. How do I make it so that in two different files header.php and header-1.php, different css and js files are loaded.
Ps I was looking for an example on the Internet, but it showed how to connect different headers and that's it. I would be very happy if you can show by example how this should be implemented.