Dear all
I have this in my “header.php” snippet for all pages but would need to exclude “home” showing up in the homepage only;*
how can I achieve it?
<span class="title"><h1><?= $page->title() ?></h1></span>
<h1><?= $page->text()?></h1>
Dear all
I have this in my “header.php” snippet for all pages but would need to exclude “home” showing up in the homepage only;*
how can I achieve it?
<span class="title"><h1><?= $page->title() ?></h1></span>
<h1><?= $page->text()?></h1>
You can use ->isHomePage()
method:
<?php if ($page->isHomePage() === false): ?>
<span class="title"><h1><?= $page->title() ?></h1></span>
<?php endif ?>
<h1><?= $page->text()?></h1>
thank you Ahmet !
Unrelated to your question, but your HTML is not valid. You cannot use a block level element like hx inside a span element. Also, a h1 followed by another h1 doesn’t make sense, either.
Should I use a div class ?
I just started html and Kirby 2 weeks ago
So I know nothing
I’m just filling all site in h1 to see content anyways
I’ll adjust hierarchies at the end plus CSS styling
In the example, the span is totally unnecessary, and you can assign the title class to the h1, so I’d just remove the span.
Other than that, happy learning!
Just learned i can asign class to h1 thanks to you here then !!
Hahahahaa I know it’s basic for you but I’m just doing my first baby steps
danke sonya !