Home › Forum › Problemi Vari con WP › Immagini nel loop
-
AutorePost
-
-
10 Marzo 2011 alle 13:35 #17092mic3000Partecipante
Ciao,
vorrei sapere come e se è possibile richiamare una determinata immagine nel loop.
Mi spiego meglio, come richiamare un’immagine mi è chiaro, quello che non riesco a capire è come richiamare le immagini ridimensionate al momento dell’upload.
Se wordpress ad esempio oltre alla dimensione originale dell’immagine, mi crea altre con dimensioni 150×150 etc, come posso richiamare quelle immagini?
E’ chiaro che includendo direttamente le immagini più piccole, senza essere obbligati ad inserire quelle a grandezza naturale e magari forzando le dimensioni con i css, le prestazioni ne trarranno beneficio!
Grazie in anticipo!
Ciao!
-
10 Marzo 2011 alle 13:58 #82164SteveAglAmministratore del forum
http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src
puoi passare i parametri della dimensione desiderata e ti torna un array di imamgini co url e dimensioni…
-
10 Marzo 2011 alle 14:25 #82165mic3000Partecipante
in questo l’array mi restituisce URL whidth e height, non scelgo se visualizzare miaimg-150×150.jpg o miaimg-50×50.jpg etc..
Forse in questo modo, http://codex.wordpress.org/Function_Reference/the_post_thumbnail
ed utilizzando
the_post_thumbnail(); // without parameter -> Thumbnail
the_post_thumbnail('thumbnail'); // Thumbnail (default 150px x 150px max)
the_post_thumbnail('medium'); // Medium resolution (default 300px x 300px max)
the_post_thumbnail('large'); // Large resolution (default 640px x 640px max)
the_post_thumbnail( array(100,100) ); // Other resolutions
-
10 Marzo 2011 alle 15:13 #82168SteveAglAmministratore del forum
si anche la mia se gli apssi una dimensione prende quella e ti da un array di tutti gli allegati al post…
il tuo va bene uguale strade diverse stesso risultato
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.