LoginSignup
0
0

More than 5 years have passed since last update.

WP:子テーマ作成の際に@importしない

Last updated at Posted at 2015-10-30

functions.phpにて

add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'child-style',
        get_stylesheet_directory_uri() . '/style.css',
        array('parent-style')
    );
}

子テーマのstyle.cssにて

/*
Theme Name:   My Theme Child(子テーマ名)
Template:     twentyfifteen(継承元親テーマのフォルダ名)
*/

と、それぞれ記述する。


  • function.phpではなくてfunctions.php
  • style.cssはthemeフォルダの直下。themefolder/css/ではない!
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0