Add Images on Website

I try the new code, but it doesn’t work. I also wonder why the code from the tutorial doesn’t work. But I have to apologize, I am a beginner :slight_smile:
This ist my complete php file. Maybe there ist something on the wrong position?

//<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?= $site->title() ?></title>

<?= css('portfolio.css') ?>

</head>


<body>

<header class="header">

   <a class="logo" href="<?= $site->url() ?>"><?= $site->title() ?></a>

        <nav class="menu">
            <ul>
            <?php foreach ($site->children()->listed() as $subpage): ?>
            <a href="<?= $subpage->url() ?>"><?= $subpage->title() ?></a>
            <?php endforeach ?>
        </ul>
    </nav>
</header>



<main class="title">
    <h1><?= $page->title() ?></h1>
</main>


<main class="text">
    <?= $page->text() ?>
</main>




<div class="gallery">

<ul>
    <?php foreach ($page->images() as $image): ?>
        <li>
            <a href="<?= $image->url() ?>">
              <img alt="<?= $image->alt() ?>" src="<?= $image->url() ?>">
                <? $image ?>
            </a>
        </li>
    <?php endforeach ?>
</ul>

</div>



</body>

</html>