header problem SimpleBlog & Watercolor.

Ask for help or provide support to other members.
Post Reply
dlb
Posts: 3
Joined: Wed Nov 12, 2025 9:11 am

header problem SimpleBlog & Watercolor.

Post by dlb »

Hi everyone.

I've discovered a bug with the simpleblog plugin associated with watercolor theme.

I didn't had much time to dig in but I think simpleblog is modifying or bypassing the h3 header.

Watercolor show a 404 in the header of the blog page (the blue/green colored part), with the blog itself appearing under as intended.

The 404 header appear only when you're logged out.
Once logged in, the header is visible and editable.

I'll try to solve this when i'll find time but i'd appreciate if you have few hints which would save me some headache :)

Thanks

Avril
dlb
Posts: 3
Joined: Wed Nov 12, 2025 9:11 am

Re: header problem SimpleBlog & Watercolor.

Post by dlb »

I've made some additions to the theme.php of watercolor theme.

It's now working with the simpleblog plugin. i didn't test without the plugin but it should work just as usual

here is the modified code of the whole header section: (my contribution is between <addition> 1 & 2)

Wish you a nice day :)


<header>

<!-- ADDITION 1: check if page is in simpleblog.json then know its a blog page -->
<?php
$isBlogPage = false;
$isBlogPost = false;
$blogPostSlug = '';

if (!isset($Wcms->get("pages")->{$Wcms->currentPage}) && $Wcms->currentPage !== 'home' && $Wcms->currentPage !== $Wcms->get("config", "login")) {
$blogDataPath = $Wcms->dataPath . '/simpleblog.json';
if (file_exists($blogDataPath)) {
$blogData = json_decode(file_get_contents($blogDataPath));
if (isset($blogData->posts->{$Wcms->currentPage})) {
$isBlogPost = true;
$blogPostSlug = $Wcms->currentPage;
$isBlogPage = true;
} elseif ($Wcms->currentPage === 'blog') {
$isBlogPage = true;
}
}
}
?>
<!-- END OF ADDITION 1-->
<?php if($Wcms->currentPage === $Wcms->get("config", "defaultPage")): ?>
<div class="header-content container">
<?= newEditableArea("{$Wcms->currentPage}_header", "
<h1>Hi! <span>I'm Watercolor.</span></h1>
<span>This is a detailed watercolor theme by <a href=\"https://steph.tools\">Stephan Stanisic</a>.</span>

<div class=\"header-socials\">
<a href=\"https://nitter.net/\"><svg viewBox=\"0 0 496 512\"><use xlink:href=\"#fab-twitter\"></use></svg></a>
<a href=\"https://joinmastodon.org\"><svg viewBox=\"0 0 496 512\"><use xlink:href=\"#fab-mastodon\"></use></svg></a>
<a href=\"http://delta.chat\"><svg viewBox=\"0 0 496 512\"><use xlink:href=\"#fas-comment\"></use></svg></a>
</div>
") ?>
</div>
<div class="icon-scroll"></div>
<?php elseif($Wcms->currentPage === $Wcms->get("config", "login")): ?>
<div class="header-content container">
<h1>Login</h1>
</div>
<?php elseif($Wcms->loggedIn): ?>
<div class="header-content">
<?= newEditableArea("{$Wcms->currentPage}_header", "<h1>Page <span>Title.</span></h1>
<span>And a subtitle</span>") ?>
</div>
<!-- ADDITION 2: show header for blog and blog/post -->
<?php elseif($isBlogPost): ?>
<div class="header-content">
<?= $Wcms->block("{$blogPostSlug}_header") ?>
</div>
<?php elseif($Wcms->currentPage === 'blog'): ?>
<div class="header-content">
<?= $Wcms->block("blog_header") ?>
</div>
<!-- END OF ADDITION 2 -->
<?php elseif(isset($Wcms->get("pages")->{$Wcms->currentPage})): ?>
<div class="header-content">
<?= $Wcms->block("{$Wcms->currentPage}_header") ?>
</div>
<?php else: ?>
<div class="header-content">
<?= $Wcms->block("404_header") ?>
</div>
<?php endif; ?>
</header>
Post Reply