문제

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";
?>
도움이 되었습니까?

해결책

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' );
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 wordpress.stackexchange
scroll top