Broken Links (4)

It seems that I should have used not get_stylesheet_directory() but get_stylesheet_directory_uri().

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')
);

The html file generated is: (note: spaces added to enhance readability.)

48 <link rel='stylesheet' id='parent-style-css'           href='https://spinorlab.matrix.jp/en/wp-content/themes/twentyseventeen/      style.css?ver=2017-08-03-Thu-00:25:48' type='text/css' media='all' />
49 <link rel='stylesheet' id='child-style-css'            href='https://spinorlab.matrix.jp/en/wp-content/themes/twentyseventeen-child/style.css?ver=2017-08-03-Thu-00:25:48' type='text/css' media='all' />
51 <link rel='stylesheet' id='twentyseventeen-style-css'  href='https://spinorlab.matrix.jp/en/wp-content/themes/twentyseventeen-child/style.css?ver=2017-08-03-Thu-00:25:48' type='text/css' media='all' />

We don’t need two same lines, 49 and 51, and giving the same timestamp for two different style files, parent and child, doesn’t look nice, I must admit.

Broken Links (3)

Another broken link comes from the line 49:

48 <link rel='stylesheet' id='parent-style-css'  href='https://spinorlab.matrix.jp/en/wp-content/themes/twentyseventeen/style.css?ver=2017-08-03-Thu-00:25:48' type='text/css' media='all' />
49 <link rel='stylesheet' id='child-style-css'  href='https://spinorlab.matrix.jp/en/home/xxxx/www/spinorlab/en/wp-content/themes/twentyseventeen-child/style.css?ver=2017-08-03-Thu-00:25:48' type='text/css' media='all' />
51 <link rel='stylesheet' id='twentyseventeen-style-css'  href='https://spinorlab.matrix.jp/en/wp-content/themes/twentyseventeen-child/style.css?ver=2017-08-03-Thu-00:25:48' type='text/css' media='all' />

Perhaps this relates to the followings lines in my functions.php :

function theme_enqueue_styles() {
  wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
  wp_enqueue_style( 'child-style', get_stylesheet_directory() . '/style.css', array('parent-style')
);

The function, get_stylesheet_directory(), returns the string “/home/xxx/www/spinorlab/en/wp-content/themes/twentyseventeen-child”, so how come the prefix?