-
AuthorPosts
-
June 23, 2021 at 5:09 am #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.
June 24, 2021 at 6:02 am #1307247Hey 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,
RikardJune 24, 2021 at 10:06 am #1307274Rikard, 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.
June 25, 2021 at 4:44 am #1307371Hi,
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,
RikardJune 25, 2021 at 6:06 am #1307387Here you go. Thanks!
June 26, 2021 at 8:11 am #1307502Hi,
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,
RikardJune 26, 2021 at 8:45 am #1307508Hi Rikard,
I am unable to locate “Appearance > Editor functionality”. Is this within the Dashboard or Enfold Theme Options?June 27, 2021 at 5:20 am #1307577Hi,
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,
RikardJune 27, 2021 at 6:56 am #1307579Hi 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.
June 28, 2021 at 6:47 am #1307661Hi,
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,
RikardJune 28, 2021 at 8:48 am #1307679Thank you for your help with this. It’s working .
June 29, 2021 at 5:04 am #1307848Hi,
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,
RikardJune 29, 2021 at 6:56 am #1307865Yes, 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”.
June 30, 2021 at 3:25 am #1308018 -
AuthorPosts
- The topic ‘user-scalable="no" is used in the meta viewport’ is closed to new replies.