mercredi 15 juin 2016

Adding "Media query" to If/else statements in PHP

Im using the following code to echo content in wordpress based on the size of its title.

<?php 
$title  = the_title('','',false);
if(strlen($title) > 35):
    echo content(20);
else:
    echo content(45);
endif;
?>

Is there a simple way of projecting a media query before this to echo an output based on the window width so basically for mobiles and devices

Aucun commentaire:

Enregistrer un commentaire