body {background: unset;} HEAD; } // Inject Sleeky files yourls_add_action( 'html_head', 'sleeky_head_scripts' ); function sleeky_head_scripts() { // This is so the user doesn't have to reload page twice in settings screen if (isset( $_POST['theme_choice'] )) { // User has just changed theme if ($_POST['theme_choice'] == "light") { setTheme("light"); } else { setTheme("dark"); } } else { // User has not just changed theme if (yourls_get_option( 'theme_choice' ) == "light") { setTheme("light"); } else { setTheme("dark"); } } } // Inject Sleeky files function setTheme($theme) { $url = yourls_plugin_url( __DIR__ ); if ($theme == "light") { echo << HEAD; } else if ($theme == "dark") { echo << HEAD; } } // Inject information and options into the frontend yourls_add_action( 'html_head', 'addOptions' ); function addOptions() { $url = yourls_plugin_url( __DIR__ ); echo << HEAD; }