Last active
December 5, 2021 17:08
-
-
Save dartiss/6b26a192743c6fa1613c3b4014719dd3 to your computer and use it in GitHub Desktop.
Add theme color support to a WordPress site
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 | |
/** | |
* Add support for a theme colour | |
*/ | |
function add_theme_colour() { | |
?> | |
<meta name="theme-color" content="#BE702B" media="(prefers-color-scheme: light)"> | |
<meta name="theme-color" content="#333333" media="(prefers-color-scheme: dark)"> | |
<?php | |
} | |
add_action( 'wp_head', 'add_theme_colour' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment