In this update of Kalium you will be introduced to some great new features of Kalium which mostly affect the code structure of Kalium towards new future of template hierarchy and WP hooks.
Kalium is now faster, more secure and even simpler to extend or customize via child theme!
New home for template files
In the past, all Kalium templates were located in kalium/inc/ folder. Most of templates are still there, however they are all deprecated now.
We have created new implementation of theme templates which is very practical and easy to customize. The new templates will be contained in kalium/templates/ folder and separated by section, for example, all blog templates will be contained in kalium/templates/blog/ (same as WooCommerce template structure logic) and so on with other sections such as portfolio, common and other template files.
In this update we introduced the new function kalium_get_template( $file_name, $args ) to include template files which is similar to get_template_part() function however it differs in implementation, here is how it works:
kalium_get_template( 'my-example-template.php', array( 'hello' => 'world' ) );
This will search for file my-example-template.php in kalium/templates/my-example-template.php folder first and pass the local variable $hello which outputs “world” string.
If the template file exists in kalium-child/templates/my-example-template.php then the parent template will be ignored and this will be loaded.
Each Kalium template file has version number so if there is new version for that template and you are overridding and you are using older version on your child theme, you will be notified about it.
New blog structure
Blog section has been entirely recoded from scratch with simplicity and performance in mind. This is the first step that leads Kalium towards a bright future of templates which will be much easier to customize each template, modify and add new hooks and also offers an independent API for each theme section.
Blog templates are now structured with WP Hooks which are contained in:
Blog template functions (which can be overridden in your child theme) in:
And blog API functions which can be found (but could not overridden in your child theme) in:
The same structure is applied to core and other template files and in the upcoming updates of Kalium, all sections such as blog, shop, and other pages will have the same logic and hierarchy.
Important note: The old blog page templates are now deprecated. If you have overwritten any blog page template in your child theme before 2.1, those will not replace the new blog templates.
Update notes notification
The upcoming versions of Kalium may have some important changes and for that you will be informed before updating the theme. This is useful in some cases when you have made theme modifications and you are not sure whether you are safe to update the theme or not, so a notification above the theme update will appear with the important notes about that release:
Common Problems Fixes
If you encounter any problem when you update to Kalium version 2.1 then here are possible fixes for some common problems that some users can occur:
Custom CSS and Typography changes
On this update we have cleaned and minified CSS codes in Custom CSS area (on some demos where we used Custom CSS area to modify look of that demo). Also CSS rules such as font-sizes, font-weights and text-transforms that we where using on Custom CSS now are moved on the Laborator > Typography area of the theme that we introduced on version 2.0 of Kalium.
So if you want to bring those updated changes again we have have added links of the Custom CSS and Typography changes:
Applying Custom CSS and Typography changes:
- Custom CSS — From the .css file that you downloaded copy the CSS text inside then paste it in your Custom CSS area of your site. Please make sure to make a backup of your old CSS codes in case you need them again or if you have applied extra changes there.
- Typography — Open the .json file, make sure that you copy the entire code there and then apply the changes on the Typography > Settings > Advanced Font Settings > Import Font Settings, paste the code that you copied earlier and click Import Settings button. For more info please see this video.
If you update your theme from Kalium 1.x to Kalium the latest version.
Parameters and Options layout is not appearing as it should:
Portfolio or Portfolio Projects are showing 404 error:
You just need to go on your WordPress dashboard > Settings > Permalinks > select Post name and click Save. Refresh your Portfolio page again and you should see your Portfolio items.
Some rows are showing on the left and not full width etc.:
That is happening because we have deprecated Laborator Full Width option that you tweaked when you edited any Row Settings > Row stretch area.
We deprecated this because Visual Composer introduced the same thing, the same options build-in. You can easily just edit those rows again and select one of the options: Default, Stretch row, Stretch row and content and Stretch row and content (no paddings).
This article is in progress, stay tuned to get more information here!