php作成時の!DOCTYPE htmlエラーについて

実現したいこと

前提

function.phpを作成中jQueryの記述を追加したところ、テストサーバー内のホームページがエラーコードが表示された画面になったまま改善できなくなってしまいました。
phpチャッカーをかけてみたところ、header.php先頭の!DOCTYPE htmlに
PHP Parse error: syntax error, unexpected 'html' (T_STRING)
のエラーが発生していました。
改善方法を教えてください。

発生している問題・エラーメッセージ

///検証ツール 500 (Internal Server Error) ///phpチェッカー PHP Parse error: syntax error, unexpected 'html' (T_STRING)

該当のソースコード

///header.php  <!DOCTYPE html> <html <?php language_attributes(); ?>> <head> <meta charset="<?php bloginfo( 'charset' ); ?>"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="<?php bloginfo( 'description' )?>">    <?php wp_head(); ?> </head> <body <?php body_class(); ?>> <?php wp_body_open(); ?> <div class="content-Wrap"> <header role="banner" class="header"> <h1 class="header-SiteName"> <a href="<?php echo esc_url( home_url() ); ?>" class="header-SiteName_Link"> <img src="<?php echo esc_url( get_template_directory_uri() ); ?>/assets/img/logo.png" alt="<?php bloginfo( 'name' ); ?>"> </a> <span class="header-Tagline"><?php bloginfo( 'description' ); ?></span> </h1> <nav class="header-Nav"> <button type="button" class="header-NavToggle" aria-controls="global-Nav" aria-expanded="false" aria-label="メニュー開閉"> <span class="header-NavToggle_Bar"></span> </button> <div class="header-Nav_Inner" id="global-Nav" aria-hidden="true"> <ul class="header-Nav_Items"> <li><a href="#">ホーム</a></li> <li><a href="#">コンセプト</a></li> <li><a href="#">ヘアスタイル</a></li> <li><a href="#">メニュー</a></li> <li><a href="#">店舗案内</a></li> </ul> <form role="search" method="get" class="search-form" action="#"> <label> <input type="search" class="search-field" placeholder="検索 &hellip;" value="" name="s" /> </label> <input type="submit" class="search-submit" value="検索" /> </form> </div> </nav> </header> ///function.php <?php function neko_theme_setup() { add_theme_support( 'title-tag' ); } add_action( 'after_setup_theme','neko_theme_setup' ); function neko_enqueue_scripts() { wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'kuroneko-theme-common', get_template_directory_uri() . '/assets/js/theme-common.js', array(), '1.0.0' ); wp_enqueu_style( 'googlrfonts' , 'https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@500&display=swap' , array(), '1.0.0' ); wp_enqueue_style( 'kuroneko-theme-style' , get_template_direstory_uri() . '/assets/css/theme.css' , array(), '1.0.0' ); } add_action( 'wp_enqueue_scripts', 'neko_enqueue_script' );

試したこと

検証ツール、phpチェッカーでのエラー箇所特定、綴りミス確認。

補足情報(FW/ツールのバージョンなど)

「Word Pressオリジナルテーマ制作入門」で学習中でのエラーです。

コメントを投稿

0 コメント