diff --git a/docs/runbook.md b/docs/runbook.md index 7a39933..844e285 100644 --- a/docs/runbook.md +++ b/docs/runbook.md @@ -35,6 +35,19 @@ HTTPS redirects during production startup. 2. Run `docker compose --profile tools run --rm wp-cli -c 'wp theme status azionelab'`. 3. Verify file ownership before changing permissions; never make the tree world-writable. +## Uploaded image does not appear on the public page + +1. Confirm the image was selected in **Appearance > Customize**, not only uploaded in + **Media**. For the teacher portrait, use **Appearance > Customize > Il maestro > + Foto**, then publish the change. +2. Hard-refresh the browser or purge the CDN cache. An NGINX log status `304` for + `/wp-content/uploads/...` is not an application error; it means the browser already + has a cached copy and NGINX did not resend the file body. +3. If the upload appears in Media but not on the page, inspect the generated `` + URL and verify it uses the public scheme/host configured by `WP_URL`. +4. Confirm the uploaded file exists under `WORDPRESS_DATA_PATH/wp-content/uploads` and + is readable by the WordPress container user. + ## A service cannot write to its volume 1. Stop the affected service. diff --git a/wordpress/theme/azionelab/front-page.php b/wordpress/theme/azionelab/front-page.php index b7e93fb..44d354e 100644 --- a/wordpress/theme/azionelab/front-page.php +++ b/wordpress/theme/azionelab/front-page.php @@ -25,7 +25,7 @@ $features = array(
- Il gruppo durante un esercizio teatrale + '960', 'height' => '1120', 'fetchpriority' => 'high' ) ); ?>
Il gruppo รจ materia viva.
@@ -57,7 +57,7 @@ $features = array(
-
Esercizio di movimento nello spazio
+
'960', 'height' => '760', 'loading' => 'lazy' ) ); ?>

Pratica e ricerca

@@ -69,7 +69,7 @@ $features = array(
-
Ritratto di <?php echo esc_attr( azionelab_mod( 'teacher_name' ) ); ?>
+
'760', 'height' => '900', 'loading' => 'lazy' ) ); ?>

La guida del percorso

Il maestro

diff --git a/wordpress/theme/azionelab/functions.php b/wordpress/theme/azionelab/functions.php index 011e997..e8cec0c 100644 --- a/wordpress/theme/azionelab/functions.php +++ b/wordpress/theme/azionelab/functions.php @@ -45,6 +45,30 @@ function azionelab_asset( string $filename ): string { return get_theme_file_uri( 'assets/images/' . $filename ); } +function azionelab_image( string $url, string $alt, array $attributes = array() ): string { + $attributes = array_merge( + array( + 'alt' => $alt, + ), + $attributes + ); + + $attachment_id = attachment_url_to_postid( $url ); + if ( $attachment_id > 0 ) { + return wp_get_attachment_image( $attachment_id, 'large', false, $attributes ) ?: ''; + } + + $html_attributes = ''; + foreach ( $attributes as $name => $value ) { + if ( '' === (string) $value ) { + continue; + } + $html_attributes .= sprintf( ' %s="%s"', esc_attr( $name ), esc_attr( (string) $value ) ); + } + + return sprintf( '', esc_url( $url ), $html_attributes ); +} + function azionelab_phone_href( string $number ): string { return preg_replace( '/[^0-9+]/', '', $number ) ?: ''; }