Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1307059

    When I do an Accessibility check on my website (link is below in private) I get the error:
    [user-scalable=”no”] is used in the <meta name=”viewport”> element or the [maximum-scale] attribute is less than 5.

    When I view-source the page, in the header is:
    <meta name=”viewport” content=”width=device-width, initial-scale=1, maximum-scale=1″>

    However, another one of my Enfold sites (that is not getting the above alert), has the setting of:
    <meta name=”viewport” content=”width=device-width, initial-scale=1″>

    How do I go about fixing the problem? I could not find a solution in Theme Options.

    #1307247

    Hey laptophobo,

    Please try this in your functions.php file:

    function custom_viewport_scale(){
      ?>
      <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=6">
      <?php
    }
    add_action('wp_head', 'custom_viewport_scale');

    Best regards,
    Rikard

    #1307274

    Rikard, thanks for the script. But I may be including it incorrectly into my (child) function.php file. There are already some scripts in that file. Here is what’s at the end right now (before adding in your script):

    function avia_sidebar_menu($echo = true)
    {
    	$sidebar_menu = "";
    
    	$subNav = avia_get_option('page_nesting_nav');
    
    	
    	$the_id = @get_the_ID();
    	$args 	= array();
    	global $post;
    
    	if($subNav && $subNav != 'disabled' && !empty($the_id) && is_page())
    	{
    		$subNav = false;
    		$parent = $post->ID;
    		$sidebar_menu = "";
    
    		if (!empty($post->post_parent))
    		{
    			if(isset($post->ancestors)) $ancestors  = $post->ancestors;
    			if(!isset($ancestors)) $ancestors  = get_post_ancestors($post->ID);
    			$root		= count($ancestors)-1;
    			$parent 	= $ancestors[$root];
    		}
    
    		$args = array('title_li'=>'', 'child_of'=>$parent, 'echo'=>0, 'sort_column'=>'menu_order, post_title');
    
    		//enables user to change query args
    		$args = apply_filters('avia_sidebar_menu_args', $args, $post);
    
    		//hide or show child pages in menu - if the class is set to 'widget_nav_hide_child' the child pages will be hidden
    		$display_child_pages = apply_filters('avia_sidebar_menu_display_child', 'widget_nav_hide_child', $args, $post);
    
    		$children = wp_list_pages($args);
    
    		if ($children)
    		{
    			$default_sidebar = false;
    			$sidebar_menu .= "<a href='". get_the_permalink($parent) ."'>".get_the_title($parent)."</a>";
    			$sidebar_menu .= "<nav class='widget widget_nav_menu $display_child_pages'><ul class='nested_nav'>";
    			$sidebar_menu .= $children;
    			$sidebar_menu .= "</ul></nav>";
    		}
    	}
    
    	$sidebar_menu = apply_filters('avf_sidebar_menu_filter', $sidebar_menu, $args, $post);
    
    	if($echo == true) { echo $sidebar_menu; } else { return $sidebar_menu; }
    
    }

    I added your script exactly as you provided at the very end of the above. (I also tried it with an added “}” at the very end, but that did not change anything.

    #1307371

    Hi,

    Thanks for the update. Please send us a temporary WordPress admin login and login URL so that we can have a closer look. You can post the details in the Private Content section of your reply.

    Best regards,
    Rikard

    #1307387

    Here you go. Thanks!

    #1307502

    Hi,

    Thanks for that. I see that the Appearance->Editor functionality is turned off on your installation. Could you enable that, or post FTP login details in private please? Otherwise we can’t see or edit your functions.php file.

    Best regards,
    Rikard

    #1307508

    Hi Rikard,
    I am unable to locate “Appearance > Editor functionality”. Is this within the Dashboard or Enfold Theme Options?

    #1307577

    Hi,

    I’m guessing that you security plugin is disabling that, but it could be your hosting provider as well. If you don’t want to investigate that any further, then please simply post FTP login details in private instead.

    Best regards,
    Rikard

    #1307579

    Hi Rikard,
    Yes, please do go right in and look over what you need to. (I have 4 other Enfold sites waiting on your findings.)

    FTP details are in private.

    Thanks much.

    #1307661

    Hi,

    Thanks for that. I added the function, and it works, but it seems to only duplicate the meta tag. Since you have header.php in your child theme, then you can simply open that up and change the tag manually on line 51:

    if( strpos($responsive, 'responsive') !== false ) echo '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">';

    You can change maximum-scale=1 to maximum-scale=6, if it needs to be larger than 5.

    Best regards,
    Rikard

    #1307679

    Thank you for your help with this. It’s working .

    #1307848

    Hi,

    Great, I’m glad that you got it working. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #1307865

    Yes, you can close this ticket. I do have another Accessibility Compliance item I will send you guys in a separate ticket. (Soon we’ll have a complete manual done on “ADA Section 508 Compliance tweeks”.

    #1308018

    Hi,

    Thanks for letting us know, I’ll go ahead and close this thread for now then. Please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘user-scalable="no" is used in the meta viewport’ is closed to new replies.