Wish List
- NorfolkGreg
- Posts: 150
- Joined: Wed Sep 01, 2021 7:50 am
Re: Wish List
There's no error_log appeared.
Re: Wish List
Thank you Greg, great initial news.
- NorfolkGreg
- Posts: 150
- Joined: Wed Sep 01, 2021 7:50 am
Re: Wish List
I'm wondering about how best to proceed with the upgrade to the GregCustom theme to cope with v3.5.0.
The GregCustom theme.php file currently includes the following, which grossly misuses items that should only be found in <head> tags:
I take it I simply replace that with this?
and provide, in the README.md file, an upgrade section with sample code to replicate the original that they will need insert to replace the default contents provided in the v3.5.0 index.php file?
I'm still to play with the new search feature! No doubt there'll be questions!
The GregCustom theme.php file currently includes the following, which grossly misuses items that should only be found in <head> tags:
Code: Select all
<header>
<h1>
<em><?= $Wcms->get('config', 'siteTitle') ?></em><br>
<?= $Wcms->page('title') ?>
</h1>
<h2><?= $Wcms->page('description') ?></h2>
</header>
Code: Select all
<header>
<?= $Wcms->header() ?>
</header>
I'm still to play with the new search feature! No doubt there'll be questions!

- NorfolkGreg
- Posts: 150
- Joined: Wed Sep 01, 2021 7:50 am
Re: Wish List
Well, I've tried the approach above. I've replaced the index.php file with the 3.5.0 version. My theme.php file's <header> tags now contain:
but nothing appears! Obviously I expected my original, now commented, code to disappear, but looking through the 3.5.0 index file I was expecting to see the following text instead:
styled according to my <nav> styling rules.
I guess it's something that I've failed to do thanks to my ignorance of PHP code.
Code: Select all
<header>
<?= $Wcms->header() ?>
<!--
<h1>
<em><?= $Wcms->get('config', 'siteTitle') ?></em><br>
<?= $Wcms->page('title') ?>
</h1>
<h2><?= $Wcms->page('description') ?></h2>
-->
</header>
Code: Select all
You can include this in your theme.php and edit it.
I guess it's something that I've failed to do thanks to my ignorance of PHP code.
Re: Wish List
Hi Greg.
The PHP tag you should be calling is, it seems you are using the correct one.
I tested this and this appeared:
Please try this and let me know if it works for you and also check if there was any error_log generated if nothing appears.
The PHP tag you should be calling is
Code: Select all
<?= $Wcms->header() ?>
I tested this and this appeared:
Code: Select all
<nav>You can include this in your theme.php and edit it.</nav>
- NorfolkGreg
- Posts: 150
- Joined: Wed Sep 01, 2021 7:50 am
Re: Wish List
Is there something else I need to make it work other than to replace the v3.4.3 version of the index.php file with the v3.5.0 version?
Re: Wish List
Nope, it's the only file that had any changes related to this.
1. What happens if you just put the tag anywhere, without commenting out any other code?
2. Also make sure you have the 3.5.0 index.php: https://raw.githubusercontent.com/Wonde ... /index.php
3. I will try installing your theme and giving this a go.
Update From point 3, I can confirm this works just by adding the tag, or using it as you specified earlier.
Also, if you want to comment out PHP that is in HTML, you have to comment it out seperately:
1. What happens if you just put the tag anywhere, without commenting out any other code?
2. Also make sure you have the 3.5.0 index.php: https://raw.githubusercontent.com/Wonde ... /index.php
3. I will try installing your theme and giving this a go.
Update From point 3, I can confirm this works just by adding the tag, or using it as you specified earlier.
Also, if you want to comment out PHP that is in HTML, you have to comment it out seperately:
Code: Select all
<header>
<?= $Wcms->header() ?>
<!--
<h1>
<em><?= //$Wcms->get('config', 'siteTitle') ?></em><br>
<?= //$Wcms->page('title') ?>
</h1>
<h2><?= //$Wcms->page('description') ?></h2>
-->
</header>
Re: Wish List
Maybe you want to achieve this?
By calling
to include the below in your theme?
Easiest way to achieve this is:
1. In your theme folder, create functions.php file, which looks like this:
2. This will use the header hook, to modify it. So, calling in your theme will now output
3. Don't forget to put in your theme.
4. Don't forget to remove the old header code from the theme.php, which is now unnecessary since you call it from the functions.php file.
5. Tested this and it works.
By calling
Code: Select all
<?= $Wcms->header() ?>
Code: Select all
<header>
<h1>
<em><?= $Wcms->get('config', 'siteTitle') ?></em><br>
<?= $Wcms->page('title') ?>
</h1>
<h2><?= $Wcms->page('description') ?></h2>
</header>
Easiest way to achieve this is:
1. In your theme folder, create functions.php file, which looks like this:
Code: Select all
<?php
global $Wcms;
$Wcms->addListener('header', 'customHeaderOutput');
function customHeaderOutput($args) {
global $Wcms;
$content = '<header>
<h1>
<em>'. $Wcms->get('config', 'siteTitle') .'</em><br>
'. $Wcms->page('title') .'
</h1>
<h2>'. $Wcms->page('description') .'</h2>
</header>';
$args[0] = $content;
return $args;
}
?>
Code: Select all
<?= $Wcms->header() ?>
Code: Select all
<header>
<h1>
<em><?= $Wcms->get('config', 'siteTitle') ?></em><br>
<?= $Wcms->page('title') ?>
</h1>
<h2><?= $Wcms->page('description') ?></h2>
</header>
Code: Select all
<?= $Wcms->header() ?>
4. Don't forget to remove the old header code from the theme.php, which is now unnecessary since you call it from the functions.php file.
5. Tested this and it works.
- NorfolkGreg
- Posts: 150
- Joined: Wed Sep 01, 2021 7:50 am
Re: Wish List
I think there might have been an issue with caching in my earlier report. Certainly, things were a little different when I tried this morning. Perhaps I never attempted to login!wiz wrote: Fri Mar 14, 2025 8:58 pm Nope, it's the only file that had any changes related to this.
1. What happens if you just put the tag anywhere, without commenting out any other code?
2. Also make sure you have the 3.5.0 index.php: https://raw.githubusercontent.com/Wonde ... /index.php
Initially, my theme's <header> code was as before (i.e. with the call to the header and the old commented code)
The site displayed with no header and the main navigation menu (which, in my theme, is between the <header> and <section id="main"> blocks) displaying at the top of the page.
Then I logged in. Now an empty editable block displays above the navigation menu. That prompted me to edit my theme to remove the commented code so it now looks like this:
Code: Select all
<header>
<?= $Wcms->header() ?>
</header>
The one query that is left is why, throughout my tests, I do not see displayed the code:
Code: Select all
<nav>You can include this in your theme.php and edit it.</nav>
I wonder if there are some assumptions in your code that means it never gets displayed if there are <header> tags already in place in the theme file?
Re: Wish List
There are no statements or assumptions that the header would not be displayed.
I tried a fresh install and an updated one with 3.5.0 and the above worked for me.
This sounds like you might have a mistake somewhere in your code when you were making changes.
1. Make sure you don't have anything weird commented out.
2. If you can, follow the above instructions with creating a functions.php file, to see if there will be any difference.
3. This one is important: can you check your database.js and see if you have a "header" section?
I tried a fresh install and an updated one with 3.5.0 and the above worked for me.
This sounds like you might have a mistake somewhere in your code when you were making changes.
1. Make sure you don't have anything weird commented out.
2. If you can, follow the above instructions with creating a functions.php file, to see if there will be any difference.
3. This one is important: can you check your database.js and see if you have a "header" section?