Skip to content
themeforge
EN
Start free
Menu
  1. Home
  2. Attribute reference
  3. wp="is-mobile"
Core Show on a condition

A block only on phones, or only on computers

wp="is-mobile"

A “Call us” bar for phones, a heavy map only for computers: the block is not hidden by CSS, it is not printed at all.

Where it goes

On the block: wp="is-mobile" for phones and tablets, wp="is-desktop" for computers. There are also is-phone and is-tablet.

Example: a call bar on phones

Markup index.html
<div class="call-bar" wp="is-mobile">
  <a href="tel:+15550100199">Call us</a>
</div>
<div class="map" wp="is-desktop">
  <img src="images/map.png" alt="Map">
</div>
In the admin nothing to set up

—

On the site on a phone
Coffee for slow mornings Call us

What matters

  • The server decides by the browser, so a page cache must keep a separate copy for phones, or visitors get the first variant it saved.
  • For layout alone, CSS breakpoints are simpler and safer.
Alternative spelling

wp="is_mobile" works the same: the build gives an identical theme.

Ready when you are

See your site’s WordPress admin before you pay.