Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Why isn’t my stylesheet working on iPhone

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #40014
    Bluej
    Member

    Can you look at this site:
    http://capehornstrategies.com
    with stylesheet:
    http://www.capehornstrategies.com/wp-content/themes/capehorn/style.css

    Child theme based on Thematic.

    The stylesheet is responsive when resizing the browser window.

    But on iPhone the @media queries aren’t being activated. iPhone just shrinks the full page down to fit.

    I am just not seeing where the problem is — any ideas?

    Thank you

    #110796
    TheDoc
    Member

    Try adding this to your template:

    #110797
    TheDoc
    Member

    Using that code tells the smartphone to use its own device width, not the width of your regular styles.

    I *think* that should solve it!

    #110808
    Bluej
    Member

    TheDoc
    I just tried adding your meta tag and it worked perfectly:

    //add meta tag for responsive styles on iPhones
    function add_iphone_meta() { ?>
    ‹meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"›
    }
    add_action('wp_head','add_iphone_meta');

    #110809
    Bluej
    Member

    Thanks again TheDoc — it really works.

    #110828
    Kitty Giraudel
    Participant

    What’s the point of adding it with JS/PHP?

    #111574
    Bluej
    Member

    I like to have a function add it to all headers automatically. Otherwise I have to remember to add manually if have more than one template or doctype for WordPress

    #125709
    ebinezer
    Member

    I used this function in wordPress site . but error message will be display. The error message is “Call to undefined function add_action() ” . What can I do?.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘CSS’ is closed to new topics and replies.