1
votes

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
Just take the .css files from the folder and combine them into one - k1dev

2 Answers

2
votes

you can use the get_template_directory_uri() function.

example :

<link rel="stylesheet" href="<?php echo get_template_directory_uri();?>/css/style.css" />

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/