I am trying to start a company and am creating website for that company. When I look at website live it is all html and no css but i have it linked in rel stylesheet in the ehader and index.php but still no css! So i did some research online and created a functions.php file figuring that that was the issue. Now I am recieving this error
Warning: Missing argument 2 for add_action(), called in /home2/elishaday/public_html/wp-content/themes/smmwca/css/functions.php on line 7 and defined in /home2/elishaday/public_html/wp-includes/plugin.php on line 405
Fatal error: Call to undefined function get_template_uri() in /home2/elishaday/public_html/wp-content/themes/smmwca/functions.php on line 5
This is my functions.php file!
please help
<?php
add_theme_support( 'post-thumbnails' );
function enqueue2_my_custom_styles(){
wp_enqueue_style('animate css', get_template_uri() . '/css/styles.css', array(), '1.0.0', 'all');
}
add_action( 'wp_enqueue_scripts', 'enqueue2_my_custom_styles' );
The warning shows that your functions.php located in another folder(css). the functions.php must be located into the theme's root directory.
Also, That's get_template_directory_uri()
not get_template_uri()
:
<?php
add_theme_support( 'post-thumbnails' );
function enqueue2_my_custom_styles(){
wp_enqueue_style('animate css', get_template_directory_uri() . '/css/styles.css', array(), '1.0.0', 'all');
}
add_action( 'wp_enqueue_scripts', 'enqueue2_my_custom_styles' );