How to set an ad to appear only on your Mobile version Desktop of a Website

WordPress not for a long time a simple blogging platform. It allows us to develop from simple blogs with a minimalist design up to portals si Forums complex or even online shops blown, thanks Pluginacquis WooCommerce and other the E-Commerce which can be integrated into WordPress.

Except sites presentation of companies and the nonprofit which are supported by various entities, the "life" of a large website can only be supported from advertisement or products / services that it sell them. It is the same thing as with televisions that are supported solely by advertising.

Diversity can be listed devices are on an advertisement (banner) on a website, it forces it to be visible in the optimum, whether web page that is accessed from ad found mobile devices, tablet or desktop.

WordPress users who want certain ads or items to be visible only on the mobile version or only on the mobile version desktop of a web page, they have at hand a very simple WordPress function.

How to set an ad to appear only on your Mobile version Desktop of a Website

Function “wp_is_mobile"It helps us to force an element (an advertisement, in our case) to appear only when the website is accessed from a mobile phone Android, iOS or Windows Mobile.

Here's the code for an advertisement to be visible only on mobile:

<?php
if ( wp_is_mobile() ) {
	cod_reclama_sau element
}
?>

Another option is to put the code between PHP functions:

<?php if (wp_is_mobile() ) { ?>
cod_reclama_sau_element
<?php }?>

In this way, the creative code will only be visible to browsers identified as a mobile device.

In the scenario where we as a the ad should be visible only on the version desktop of the web page, in front of “wp_is_mobile” will be put “!”, which will determine that the following content will be visible on all devices, except on the mobile version.

Example code:

<?php if (!wp_is_mobile() ) { ?>
cod_reclama_sau_element
<?php }?>

This way you can manipulate elements on a web page, depending on which device is accessed.

Leave a Reply

your email address will not be published. Required fields are marked *

Total
0
Shares
Previous Article

How can we connect with Remote Desktop at a Windows PC of the MacOS (No TeamViewer)

Next Article

Safari Technology Preview - Discover how to move web technologies: HTML, JavaScript and CSS

Users searching for:

Abri todas las pestana, एक्सेल सूत्र, Instalare pe mobilu meu google play, Descarca facebok, kako na facebook ukljucit chat, telecharger jeux super mario mobile, como bloquear código no jogo crazy penguin catapult, toshibaهاتف tgo1, opera mını indır, Super.java.oyun.yukleme, windows boot manager windows 7 ไง ยัง ไง,
Total
0
Share