Visualizzazione 1 filone di risposte
Visualizzazione 1 filone di risposte
- Devi essere connesso per rispondere a questo topic.
Email: info@wpitaly.it
Home › Forum › Problemi Vari con WP › Banner pubblicitario responsive
Buonasera, Ho inserito nel file functions.php del tema il seguente codice:
__________________________________________________________________________
/* Pubblicità
/*
*/
function adsense_shortcode( $atts ) {
extract(shortcode_atts(array(
'format' => '1',
), $atts));
switch ($format) {
case 1 :
$ad = '<div id="banner"><script type="text/javascript"
src="LINK PUBBLICITARIO">
</script></div>';
break;
}
return $ad;
}
add_shortcode('adsense', 'adsense_shortcode');
__________________________________________________________________________
Quando scrivo un post inserisco alla fine [adsense], e mi appare il banner 728×90.
Vorrei rendere il banner responsive. Come posso fare??? Grazie tanto per il supporto
PS: per google maps ci sono riuscito inserendo nel file style.css il seguente codice (che è un iframe, ma nel caso del banner è uno script):
__________________________________________________________________________
/*
*
* Google Maps Responsive
/*
*/
.google-maps {
position: relative;
padding-bottom: 75%; // This is the aspect ratio
height: 0;
overflow: hidden;
}
.google-maps iframe {
position: absolute;
top: 0;
left: 0;
width: 100% !important;
height: 100% !important;
}
Vorrei rendere il banner responsive. Come posso fare???
Con i CSS media queries.
Naturalmente usando un child-theme.
WPItaly - Copyright Creative Commons: CC BY-NC-SA 4.0