0
Code
functions.php
add_action('wp_enqueue_scripts', 'enqueue_scripts');
//add_action('init', 'enqueue_scripts');
//tentei também com o init, chega a chamar as funções do functions.php e mostra algo se eu colocar o printr, mas nada dos scripts e estilos :c
function enqueue_scripts() {
wp_enqueue_style('css-lindo', get_template_directory_uri() . '/assets/css/meu-css-lindo.css');
wp_enqueue_script( 'js-bonito', get_template_directory_uri() . '/assets/js/que-js-bonito.js', true);
wp_enqueue_script( 'js-mara', get_template_directory_uri() . '/assets/js/js-mara.js', array ('jquery', 'que-js-bonito'), '1.0', true);
}
Yes the files have been checked and are in the directories, when seeing the source code nothing in the header and footer. The function is being called, if I use the add in init and put a printr appears the string.
Thank you.
It seems you need to register the style or script, take a look at this wp_register_style('my_stylesheet', plugins_url('my-stylesheet.css', FILE));, should be used before wp_enqueue_script() for each one, I will not make an answer as I am not sure.
– AnthraxisBR
Your header file has the wp_head()? function and the footer has the function: wp_footer()?
– Felipe de Farias
after I added this wp_head and wp_footer the scripts appeared but the js are printing under the css instead of at the bottom of the page.
– Sabrina