Visualizzazione 3 filoni di risposte
Visualizzazione 3 filoni di risposte
- Devi essere connesso per rispondere a questo topic.
Email: info@wpitaly.it
Home › Forum › Plugin e temi di WP › inserire un’immagine staticamente
Grazie a quanti vorranno rispondermi.
Mi sto cimentando per la prima volta con la personalizzazione di un tema.
Sto tentando di inserire staticamente – in index.php del mio tema – un’immagine con il seguente codice:
img src=”images/mia_immagine.jpg” width=”315″ height=”100″ alt=”Mia immagine”
Nella directory del mio tema ho creato la cartella images e il file index.php si trova naturalmente nello stessoo livello.
Purtroppo l’immagine non viene visualizzata.
Dove sbaglio?
Ho provato ad inserire il path assoluto e funziona, però come soluzione è terrbilmente modesta.
Ciao!
<?php bloginfo('siteurl'); ?>/wp-content/themes/Nome_del_tema/images/mia_immagine.jpg
Sempre che il percorso sia quello. Usa siteurl per sostituire il dominio nell'indirizzo assoluto.
Grazie Deeproad!
Cosଠfunziona. Rimane che non riesco a spiegarmi il perchè del mancato funzionamento con un path relativo che, fino a prova contraria, è corretto.
Un saluto.
Perché evidentemente non è corretto. La cosa importante, in questo caso, è tenere un indirizzo che funzioni a prescindere dal dominio e dal tema. Quello che ti ho suggerito prescinde dall’uno e dall’altro.
WPItaly - Copyright Creative Commons: CC BY-NC-SA 4.0