I've created an HTML/CSS design and now I'm trying to convert it to a WordPress template. I've created the stylesheet and function.php.
I have the following code in my function.php
<?php
function test_theme(){
wp_enqueue_style("customstyle", get_stylesheet_uri() )
}
add_action( 'wp_enqueue_scripts', 'test_theme' );
I've added this to my header.php
<?php wp_head(); ?>
For some reason after adding that WordPress has added a few scripts and links to the header but not my custom stylesheet
What am I doing wrong? I'm also new to wordpress development and following a youtube video.
How to create a wordpress theme from scratch:
Place your code in the index.php file according to the wordpress rules
<?php get_header(); echo "<h2>This is the index</h2>"; get_sidebar(); get_footer(); ?>
Place your CSS in the style.css according to the wordpress rules. Usually we add this at the top of the style.css so that you no longer have to enqueue it in the functions.php
/*
* Theme Name: Your theme
* Theme URI: https://yourtheme.com
* Author: Memyself Andi
* Author URI: https://yourtheme.com
* Description: My WordPress theme.
* Version: 1.0
*/
Now go into your wordpress install and go to Dashboard > Appearance > Themes > Activate "Your theme"
</div>