Site icon Osclass Documentation & Knowledge Base

Updating your themes to Osclass 3.x

In Osclass 3.x we introduce some changes on theme’s information, which is located in <your_theme_folder>/index.php

From this :

<?php
    function yourtheme_theme_info() {
        return array(
             'name'        => 'Your Theme'
            ,'version'     => '1.0'
            ,'description' => 'This is Your theme'
            ,'author_name' => 'You'
            ,'author_url'  => 'http://www.example.com/'
            ,'locations'   => array('header', 'footer')
        );
    }
 
?>


To this :

<?php
/*
Theme Name: Your Theme
Theme URI: http://www.example.com/
Description: This is Your theme
Version: 1.0
Author: You
Author URI: http://www.example.com/
Widgets: header,footer
Theme update URI: 
*/
?>


Please, pay attention to the locations field, which is now the Widgets field. Instead of an array, you should place all the widgets separated by commas.


You could also make your theme compatible with both versions (2.x and 3.x) using both codes at the same time, for example :

<?php
 
/*
Theme Name: Your Theme
Theme URI: http://www.example.com/
Description: This is Your theme
Version: 1.0
Author: You
Author URI: http://www.example.com/
Widgets: header,footer
Theme update URI: 
*/
 
 
    function yourtheme_theme_info() {
        return array(
             'name'        => 'Your Theme'
            ,'version'     => '1.0'
            ,'description' => 'This is Your theme'
            ,'author_name' => 'You'
            ,'author_url'  => 'http://www.example.com/'
            ,'locations'   => array('header', 'footer')
        );
    }
 
?>

This last example is the recommended option until the transition to 3.x branch is made.