I have an HTML template that I want to convert it to Wordpress theme. The WordPress Theme requires style.css and index.php to work but the template doesnt have a csse file instead, it has a css folder. How do I link it?
2 Answers
2
votes
0
votes
Putting it in the header will work fine. Here's the 'right' way to do it on Wordpress - the following goes in your functions.php file or custom plugin.
function thatwomanuk_header_scripts()
{
// My stylesheet
wp_register_style('mystyles', get_template_directory_uri().'/css/style.css', array(), '1.0', 'all');
wp_enqueue_style('mystyles');
}
add_action('init', 'thatwomanuk_header_scripts'); // Add Custom Scripts to wp_head
The parameters for both stylesheets and javascripts are: name/handle, source, type, array(dependencies), version, defer. The "all" at the end is the media query for this stylesheet - it might be "screen" or "print", for example.
More info here, among other places: http://www.wpbeginner.com/wp-tutorials/how-to-properly-add-javascripts-and-styles-in-wordpress/