I am creating a new theme, I created a new directory called mytheme and created three files directly inside the directory where the content is as follow:
index.php
<?php echo "hellow world"; ?>
style.css
/*
Theme Name: mytheme
*/
body {background: red;}
functions.php
<?php wp_enqueue_style( 'style', get_stylesheet_uri() ); ?>
the problem: the dashboard is colored in red.
expectations: the website itself to be colored in red.
Edit:
the solution marked is only half the answer.
index.php needs to have headers initiated otherwise it wont work
index.php is now:
<?php wp_header(); echo "hellow world"; ?>
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
You need to enqueue your stylesheets and script to wp_enqueue_scripts hook.
In your functions.php try
function enqueue_scripts_cp() {
wp_enqueue_style( 'style', get_stylesheet_uri() );
}
add_action( 'wp_enqueue_scripts', 'enqueue_scripts_cp' );
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0