Hiding a php element from mobile browsers

Question

I’ve stuck a static width content slider on my WordPress sites front page. I’m using the Twenty Eleven theme with a small piece of code included into index.php to display the slider. Unfortunately because of how the theme handles mobile browsers, it causes the slider to push across the screen without the rest of the theme following it. So I was wondering if there was a way to hide the slider from mobile browsers?

The code inserted into the theme is as follows:

<?php if (function_exists('rps_show')) echo rps_show(); ?>

And in context:

  <?php    
  get_header(); ?>
  <p><h1 style="font-size:200%">Todays' featured posts</h1>
  <?php if (function_exists('rps_show')) echo rps_show(); ?>
  </br>
            <div id="primary">
        <div id="content" role="main">

        <?php if ( have_posts() ) : ?>

            <?php twentyeleven_content_nav( 'nav-above' ); ?>

            <?php /* Start the Loop */ ?>
            <?php while ( have_posts() ) : the_post(); ?>

                <?php get_template_part( 'content', get_post_format() ); ?>

            <?php endwhile; ?>

Any ideas?

0
Nikolai Baker 1 month 0 Answers 6 views 0

Leave an answer