Home › Forum › Problemi Vari con WP › Problema dimensioni immagine
-
AutorePost
-
-
21 Ottobre 2016 alle 11:46 #31121webenitoPartecipante
Ciao a tutti,
sto lavorando ad un sito molto semplice, ma riscontro un problema che non capisco:
uso il tema ILLDY
ho impostato tutto tranquillamente.
ma mi servirebbe modificare le dimensioni delle immagini in evidenza che appaiono nel blog, e renderle quadrate.
Ho notato che le dimensioni vengono affidate tramite il file functions.php, pertanto sono andato a modificare il parametro. Salvo. Ma non succede nulla.
Su un’altra installazione che avevo fatto invece funzionava tranquillamente.
Sapreste aiutarmi?
grazie mille anticipatamente.
-
21 Ottobre 2016 alle 11:52 #120937TittiModeratore
Il tema originale non si tocca. Devi creare un child theme e poi fare le modifiche opportune.
Ogni tema lavora a modo suo, non c’è una procedura univoca.
NB: impara a mettere titoli consoni ai tuoi topic (non è un problema del file “function”, che neppure esiste) e a mettere i link richiesti.
-
22 Ottobre 2016 alle 17:22 #120950webenitoPartecipante
Ciao mi scuso per gli errori.
ho seguito il tuo consiglio ed ho iniziato ad usare un tema CHILD.
il problema però persiste.
ho le immagini in evidenza che nella pagina BLOG si vedono ad una certa dimensione, mentre io vorrei poterle vedere quadrate.
nella prima installazione avevo risolto andando a modificare, anche se erronemente, il file functions.php
// Add Image Size
add_image_size( ‘illdy-blog-list’, 500, 100, true );
add_image_size( ‘illdy-widget-recent-posts’, 70, 70, true );
add_image_size( ‘illdy-blog-post-related-articles’, 240, 206, true );
add_image_size( ‘illdy-front-page-latest-news’,360, 213, true );
add_image_size( ‘illdy-front-page-testimonials’, 127, 127, true );
add_image_size( ‘illdy-front-page-projects’, 476, 476, true );
add_image_size( ‘illdy-front-page-person’, 125, 125, true );
ma adesso nel tema child ho provato a farlo inserendo questo codice:
<?php add_action( ‘wp_enqueue_scripts’, ‘enqueue_parent_theme_style’ ); function enqueue_parent_theme_style() { wp_enqueue_style( ‘parent-style’, get_template_directory_uri().’/style.css’ ); }
add_action( ‘after_setup_theme’, ‘my_child_theme_image_size’ );
function my_child_theme_image_size() {
remove_image_size( ‘illdy-blog-list’ );
remove_image_size( ‘illdy-front-page-latest-news’ );
add_image_size( ‘illdy-blog-list’, 500, 500, true );
add_image_size( ‘illdy-front-page-latest-news’, true ); //360, 213,
}
però non accade nulla. continuo ad avere lo stesso problema.
come posso fare a modificare le dimensioni delle immagini?
grazie anticipatamente.
-
23 Ottobre 2016 alle 7:28 #120951nickPartecipante
però non accade nulla. continuo ad avere lo stesso problema.
come posso fare a modificare le dimensioni delle immagini?
Non accade nulla perché le tue modifiche hanno effetto solo sulle nuove immagini.
Per fare in modo che le immagini che hai già caricato vengano ridimensionate puoi usare un plugin come questo: https://it.wordpress.org/plugins/regenerate-thumbnails/
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.