Built off Genesis Sample theme and can't get mobile viewport meta tag to appear.

Community Forums Forums Design Tips and Tricks Built off Genesis Sample theme and can't get mobile viewport meta tag to appear.

This topic is: not resolved

This topic contains 2 replies, has 3 voices, and was last updated by  Doak Heggeness 1 year, 3 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #34359

    mattspaeth
    Participant
    Post count: 11

    I have a lot of experience modifying existing Studiopress mobile responsive themes. All of those worked. This is the first built using the Genesis Sample Theme.

    Added the following to my functions.php


    /** Add Viewport meta tag for mobile browsers */
    add_action( 'genesis_meta', 'custom_viewport_meta_tag' );
    function custom_viewport_meta_tag() {
    echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>';
    }

    add_theme_support( 'genesis-responsive-viewport' );

    It’s not appearing in the header. While my theme is responding to resizing the browser window, it’s just appearing full width on mobile devices.

    #34369

    Ozzy
    Participant
    Post count: 211

    do you have a link to the site?


    #34375

    Doak Heggeness
    Participant
    Post count: 140

    mattspaeth,

    You are a little ahead of the game. add_theme_support(); will be valid with Genesis 2.0; whenever that is released. For now drop that and use:

    /** Add Viewport meta tag for mobile browsers */
    add_action( 'genesis_meta', 'custom_viewport_meta_tag' );
    function custom_viewport_meta_tag() {
    echo '';
    }

    You should see it in your header. I had trouble finding it myself.


    Doak Heggeness, WordPress Development | Website

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.