Insert Header and Footer Code
Provides two configurable injection points — wp_head and wp_footer — so you can paste any scripts or markup into every page without editing theme files.
PHPby SnipCraft
php
<?php
if ( ! function_exists( 'scseed_header_code' ) ) :
function scseed_header_code() {
// Paste your header scripts or markup between the quotes below.
// Example: '<link rel="preconnect" href="https://fonts.googleapis.com">'
$header_code = '';
if ( $header_code ) {
echo $header_code . PHP_EOL; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
add_action( 'wp_head', 'scseed_header_code', 99 );
endif;
if ( ! function_exists( 'scseed_footer_code' ) ) :
function scseed_footer_code() {
// Paste your footer scripts or markup between the quotes below.
// Example: '<script src="https://cdn.example.com/widget.js" defer></script>'
$footer_code = '';
if ( $footer_code ) {
echo $footer_code . PHP_EOL; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
add_action( 'wp_footer', 'scseed_footer_code', 99 );
endif;#customization#footer#head#injection#scripts