How to change the address bar color for your WordPress site on Mobile

Posted in: How to,Wordpress

I recently gave my site a nifty update by updating the color of the address bar in Chrome on mobile, thought I would share. This currently works only on Android devices using Chrome (Lollipop or newer versions)

Open up your themes functions file, or you can just pop this code in your header.php file. I am a big fan of keep all functions in the functions.php file

Create the name I will use a function named android_meta for this tutorial. Copy and paste theto your functions file or header.php file. Change the content= to the color of your choice.

Don’t forget to use wordpress function add_action to add the meta tags to the head of the document if you are inserting this in the functions.php file. You should see the color of the bar in Chrome with the new one you selected.

function android_meta(){ ?>
 <meta name="theme-color" content="#F171AB">

<? }


Here is a screenshot of how looks

Leave a Reply

Your email address will not be published. Required fields are marked *