How to change address bar color?

Hello,

I would like to update the background color of the address bar on mobile browsers to fit the branding of my site (ie, if you go to Buzzfeed.com on mobile, the address bar is red to fit their branding.)

I read an online guide that said I should edit the header.php file with the following line of code:

(this is the color I want to use.)

However, when I add this code to my header.php file, Wordpress gives me an error.

How should I apply this change to X theme?

Thanks!

Dan

Hi Dan,

Please install and activate the child theme and login through FTP then edit the functions.php then add this code:


add_action('wp_head', 'add_header_code');
function add_header_code(){
?>
    <meta name="theme-color" content="#ff6600" />
<?php
};

Please change the color value in content="#ff6600" to the color you want to use.

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.