Skip to content

Instantly share code, notes, and snippets.

@shimakyohsuke
Created June 17, 2015 09:26
Show Gist options
  • Save shimakyohsuke/14e07c79bbbba4bf5b52 to your computer and use it in GitHub Desktop.
Save shimakyohsuke/14e07c79bbbba4bf5b52 to your computer and use it in GitHub Desktop.
WordPress で親テーマのスタイルシートを呼び出す方法
<?php
function my_style() {
wp_enqueue_style( 'parent-style', dirname( get_template_directory_uri() ) . '/twentyfifteen/style.css' );
}
add_action( 'wp_enqueue_scripts', 'my_style' );
/*
Theme Name: child-twentyfifteen
Theme URI:
Description:
Template: twentyfifteen
Author: SHIMAKYOHSUKE
Author URI: http://SHIMAKYOHSUKE.com/
Version:
*/
/* functions.php に親テーマのスタイルシートのリンクを出力したほうがパフォーマンスがいい */
/* @import url('../twentyfifteen/style.css'); */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment