Viewport Content


目录

The theme has a viewport meta tag, 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

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">

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' );

The result:

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

版本号 #2
由 壳壳虫 创建于 2026-03-26 17:08:44 UTC
由 壳壳虫 更新于 2026-03-26 17:08:44 UTC