В функциях. php Я добавил следующее:
add_action ('wp_footer', '_head_ js');
, который обращается к следующая функция:
function _head_js()
{ ?>
<script>
window.onload = (() =>
{
categ = document.getElementById('cat');
categ.firstElementChild.innerHTML = 'Categories';
});
</script>
<?php }
Теперь мой add_action('wp_enqueue_scripts', '_load');
больше не работает.
Наша функция _load:
function _load()
{
wp_enqueue_style('main', get_stylesheet_uri() );
wp_enqueue_style('icons', '//cdnjs.cloudflare.com/ajax/libs/material-design-iconic-font/2.2.0/css/material-design-iconic-font.min.css');
wp_enqueue_script('main', get_template_directory_uri() . '/js/main.js', false);
};