Skip to content

Instantly share code, notes, and snippets.

@dartiss
Last active December 5, 2021 17:08
Show Gist options
  • Save dartiss/6b26a192743c6fa1613c3b4014719dd3 to your computer and use it in GitHub Desktop.
Save dartiss/6b26a192743c6fa1613c3b4014719dd3 to your computer and use it in GitHub Desktop.
Add theme color support to a WordPress site
<?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