Hiding mobile browser searchbar by using mobile app meta tags?

30 Views Asked by At

Okay so I know that things like scrollTo doesnt work anymore.

But I found an idea to use meta tags to make any browser believe that your website is a mobile app and because of that hiding the searchbar on pageload.

My take on this was to add the tags to the functions.php.

I tried this code:

// Add custom meta tags to the head section of the website
function add_custom_meta_tags_to_head() {
?>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="mobile-web-app-capable" content="yes">
    <link rel="icon" sizes="192x192" href="path/to/icon.png">
<?php
}
add_action('wp_head', 'add_custom_meta_tags_to_head');
// Add custom meta tags to the head section of the website

but somehow it it doesnt work.

Now is the question is my code wrong or is this method another dead end?

With kind regards Chris

0

There are 0 best solutions below