Daily Ramblings of a Full Stack Web Developer

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

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">

<? }

add_action('wp_head','android_meta');

Here is a screenshot of how Roguedzines.com looks

About

© Copyright Thischickcodes . 2024
Crafted with by CodeandPixelStudio