How to use wp_is_moobile function
-
Hi, i’m new using word press, and i have been doing my own web site, but the problem is that an image goes in a certain way on mobile site, and when you are in desktop way looks bad. so i want to use the function in the style.css to be able to add margin on desktop and on mobile eliminate the margin, but i can not find the way how to use it.
this is the original.
.adsng-cover img {
margin-left: -30px;
margin-bottom: 40px;
width: 310px;
height: 310px;
}this is the one i edited from the original. this control the aspect of the image. And i want to have different values on mobile and on desktop (basically the margin). i saw the function on the web but i don’t know how to use it.
.adsng-cover img {
if ( wp_is_mobile() ) {
margin-left: -30px;
margin-bottom: 40px;
width: 310px;
height: 310px;} else {
margin-left: 0px;
margin-bottom: 40px;
width: 310px;
height: 310px;}
Can someone help Me?
Kind Regards.
- The topic ‘How to use wp_is_moobile function’ is closed to new replies.