Adding css/stylesheet to a custom theme I'm builing from scratch
-
I am creating a custom theme from scratch and need to know how to add the basic css/stylesheet to my files/folders. Here is the code I have:
Functions PHP
<?phpfunction puzld_script_enqueue() {
wp_enqueue_style(‘customstyle’, get_template_directory_uri() . ‘/css/puzld.css’, array(), ‘1.0.0’, ‘all’);
wp_enqueue_script(‘customjs’, get_template_directory_uri() . ‘/js/puzld.js’, array(), ‘1.0.0’, true);
}add_action(‘wp_enqueue_scripts’, ‘puzld_script_enqueue’);
function puzld_theme_setup() {
add_theme_support(‘menus’);
register_nav_menu(‘primary’, ‘Header’);
register_nav_menu(‘primary2’, ‘Header2’);
register_nav_menu(‘secondary1’, ‘Footer’);
register_nav_menu(‘secondary’, ‘Footer2’);
}add_action(‘init’, ‘puzld_theme_setup’);
add_theme_support(‘custom-background’);
add_theme_support(‘custom-header’);
add_theme_support(‘post-thumbnails’);I have a feeling that I need to change the:
wp_enqueue_style(‘customstyle’, get_template_directory_uri() . ‘/css/puzld.css’, array(), ‘1.0.0’, ‘all’);
wp_enqueue_script(‘customjs’, get_template_directory_uri() . ‘/js/puzld.js’, array(), ‘1.0.0’, true);
}
to something else. Maybe getting rid of the wp_enqueue_script… and changing the customstyle and ‘/css/puzld.css’ to something else. I don’t want to use bootstrap and I believe that is what this is setting me up for.
I believe if this is changed properly I could just use the style.css file for my css coding. ???Thanks!
- The topic ‘Adding css/stylesheet to a custom theme I'm builing from scratch’ is closed to new replies.