Jump to content

hide the following on mobile


turkspartan

Recommended Posts

So I have this code in my header.php

<?php/** * Header Template * * @package Mysitemyway * @subpackage Template */?><!DOCTYPE html><!--[if lt IE 7]>  <html class="ie ie6 lte9 lte8 lte7" <?php language_attributes(); ?>> <![endif]--><!--[if IE 7]>     <html class="ie ie7 lte9 lte8 lte7" <?php language_attributes(); ?>> <![endif]--><!--[if IE 8]>     <html class="ie ie8 lte9 lte8" <?php language_attributes(); ?>> <![endif]--><!--[if IE 9]>     <html class="ie ie9 lte9" <?php language_attributes(); ?>> <![endif]--><!--[if gt IE 9]>  <html> <![endif]--><!--[if !IE]><!--> <html <?php language_attributes(); ?>> <!--<![endif]--><head><meta charset="<?php bloginfo( 'charset' ); ?>" /><title><?php mysite_document_title(); ?></title><link rel="profile" href="http://gmpg.org/xfn/11" /><link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" /><?php mysite_head(); ?><?php wp_head(); ?><link rel="stylesheet" type="text/css" href="http://www.hirehousekeeping.com/wp-content/themes/infocus/web_icons/dc_web_icons.css"><link rel="stylesheet" type="text/css" href="http://www.hirehousekeeping.com/wp-content/themes/infocus/web_icons2/dc_web_icons2.css"><link rel="stylesheet" href="http://cdn.dcodes.net/2/3d_buttons/css/dc_3d_buttons.css" /><link rel="stylesheet" type="text/css" href="http://www.hirehousekeeping.com/wp-content/themes/infocus/dc_gradient_buttons.css"></head><body class="<?php mysite_body_class(); ?>"><div class="multibg"><div class="multibg"></div></div><div id="body_inner">    <?php mysite_before_header();?><div id="header">        <div id="header_inner">            <p align="right"><a href="#" class="dc_gradient_button large">Book Now</a></p>        <?php mysite_header();                ?></div><!-- #header_inner -->    </div><!-- #header -->    <?php mysite_after_header();?><div id="content">        <div id="content_inner">                        <?php mysite_before_main();                        ?><div id="main">                <div id="main_inner">                    <?php mysite_before_page_content(); ?>
how can I hide the part that says the following, when on a mobile device?
   <p align="right"><a href="#" class="dc_gradient_button large">Book Now</a></p>
Link to comment
Share on other sites

You can use this function to get information about the browser:

 

http://www.php.net/manual/en/function.get-browser.php

 

Use print_r with the return value to see what it contains. It looks like there is a property called ismobiledevice that you can use. Look at the notes on that manual page, you need to set up a browscap configuration file for that to work if it's not already set up. If that's not possible then you need to use Javascript to parse the user agent string and try to determine if it's a mobile device.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...