# Viewport Content

Hello Elementor Theme Basic

The theme has a viewport meta tag (opens new window), in the head, that controls the viewport's size and shape. Developers can modify the content attribute of the meta tag using a filter hook in a child-theme.

# Hook Details

  • Hook Type: Filter Hook
  • Hook Name: hello_elementor_viewport_content
  • Default Value: width=device-width, initial-scale=1

The hook controls the content of the viewport meta tag. By default the viewport width is set to the device-width and the initial scale is set to 1:

<meta name="viewport" content="width=device-width, initial-scale=1">
1

# Usage

To modify the viewport content, use the following hook in a child-theme functions.php file:

function custom_hello_elementor_viewport_content() {
	return 'width=100vw, height=100vh, user-scalable=no';
}
add_filter( 'hello_elementor_viewport_content', 'custom_hello_elementor_viewport_content' );
1
2
3
4

The result:

<meta name="viewport" content="width=100vw, height=100vh, user-scalable=no">
1