Subject: How to install a theme?
Posted on: 19/05/21 03:58pm
I've tried for a while now to set up a theme, but the documentation on the topic seems to be outdated, from at least one version ago, and doesn't work.
I've tried downloading an existing one (newspaper_en) and also tried to copy and modify denim, going through lots of source code.
No matter what I try, the usersettings.php page will go blank once I've uploaded a new theme - but I can't find anywhere a place to add my new theme to get it included in the dropdown.
I hope someone can help me here!
PS: The documentation on this server also is not the most current.
Re: How to install a theme?
Posted on: 19/05/21 11:38pm
newspaper_en is an old theme and would need to be updated before it can be used for Geeklog version 2 and newer.
Our theme documentation does need to be updated as it is outdated. Sorry about that.
The easiest way to start a new theme is to use a child theme.
A child theme is based on another theme (called the default theme).
The best way to go about this is to create a new directory for your theme in the layout directory. Name the directory the name of your new theme.
Then pick either denim or denim_three as your default theme and copy over the functions.php and all css, js, and image files from the default theme folder. Include any sub folders that have any js, css, or image files.
Then load the functions.php file from your themes folder into a text editor and update all the function names and remove the parent name from the function and add your theme name. So for example theme_js_libs_denim would become theme_js_libs_your_theme_name.
Then in functions.php file you would have to update the config setting theme_default to point to the default theme. For example
'theme_default' => 'denim',
It's a little complicated I know but at this point you can then change the css files of your theme to update the look as you want. All the template files from your new theme will be using the default themes template files. If you want to update these template files and change them for your own theme then all you need to do is copy the template file you want from the default theme folder to your theme folder and then apply the changes.
The reason why you want to use a child theme is when a new version of Geeklog gets released (which usually includes theme updates) your theme will benefit by these changes if it continues to use the denim theme templates when needed.
There are some handle config settings in the main Geeklog Configuration for themes as well. Enabling "Template Comments in Output?" makes it easier when looking at the source html of a page to see where and what template files are used on a page.
Hope that helps!
Re: How to install a theme?
Posted on: 20/05/21 10:02am
Thanks for the quick reply!
I just uploaded it again, and it's working.
No idea what the problem was, I didn't change anything, but now it works. Maybe some file got corrupted during the upload processs before.
Admittedly, it's not a child, but I'll follow your advice later and delete the not needed stuff.
Now to figure out what to change to modify it to my tastes.
I'm a bit rusty, but I used to be able to do work in html and css, so hopefully I'll be fine once I understand the structure.
PS: I thought newspaper_en was the newest on offer, must have sorted them wrong, though ... but then again none in the downloads section is younger than 5 years, so I guess they don't work, either.
Geeklog - Forum