WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/wp is mobile

Contents

Description

This Conditional Tag checks if the user is visiting using a mobile device. This is a boolean function, meaning it returns either TRUE or FALSE.

Usage

<?php wp_is_mobile(); ?>

Parameters

This tag does not accept any parameters.

Examples

<?php if ( wp_is_mobile() ) {
	/* Display and echo mobile specific stuff here */
} ?>

Change Log

  • Since: 3.4

Source File

wp_is_mobile() is located in wp-includes/vars.php.

See also index of Function Reference and index of Template Tags.