Created
April 3, 2020 10:10
-
-
Save lunaluna/5a25cd22714370c0d067d4e39ba90627 to your computer and use it in GitHub Desktop.
body開始タグ直後にソースコードを挿入
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*********************************/ | |
/* | |
/* bodyタグ開始直後にコードを挿入 | |
/* | |
/*********************************/ | |
add_action( 'wp_body_open', function() { | |
?> | |
<?php // 挿入したいコードの例 ?> | |
<noscript> | |
... | |
</noscript> | |
<?php | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html <?php language_attributes(); ?>> | |
<head> | |
<meta charset="<?php bloginfo( 'charset' ); ?>"> | |
<?php wp_head(); ?> | |
</head> | |
<body <?php body_class(); ?>> | |
<?php | |
if ( function_exists( 'wp_body_open' ) ) { | |
wp_body_open(); | |
} | |
?> | |
<?php wp_footer(); ?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
wp_body_open() | Function | WordPress Developer Resources
wp_body_open | Hook | WordPress Developer Resources