Create a Child theme based on Zenon Pro

posted in: Software, WordPress | 0

If you are using the WordPress Zenon theme and need to make some heavy customization, you may want to follow the best practices to create a child theme. Unfortunately, the Zenon theme does not support the child themes due to some inconsistent coding. The following patches to the main theme will allow the support child themes. This code should work for the Lite and Pro version, but it has not been tested on the Lite version. The code was passed back to the theme developer for inclusion in future releases and hopefully a future release will include it. In case you need the patch before it is released into the theme, here it is:

in functions.php

at line 450

if ( STYLESHEETPATH == TEMPLATEPATH ) {
define('OPTIONS_FRAMEWORK_URL', TEMPLATEPATH . '/admin/');
define('OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/admin/');
} else {
define('OPTIONS_FRAMEWORK_URL', STYLESHEETPATH . '/admin/');
define('OPTIONS_FRAMEWORK_DIRECTORY', get_stylesheet_directory_uri() . '/admin/');
}

change to

if (is_dir(STYLESHEETPATH.'/admin/')) {
define('OPTIONS_FRAMEWORK_URL', STYLESHEETPATH . '/admin/');
define('OPTIONS_FRAMEWORK_DIRECTORY', get_stylesheet_directory_uri() . '/admin/');
} else {
define('OPTIONS_FRAMEWORK_URL', TEMPLATEPATH . '/admin/');
define('OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/admin/');
}

in options.php

at line 79

$imagepath = get_stylesheet_directory_uri() . '/admin/images/';

change to

$imagepath = OPTIONS_FRAMEWORK_DIRECTORY . 'images/';

in admin/options_framework.php

at line 194

jQuery('#of-option-documentation').load('/admin/documentation.php', function(){
jQuery.getScript("/admin/js/external.js", function(){});
});
});
jQuery('#of-option-about').load('/admin/about.php')
jQuery('#of-option-upgrade').load('/admin/upgrade.php')
});

change to

jQuery('#of-option-documentation').load('documentation.php', function(){
jQuery.getScript("js/external.js", function(){});
});
});
jQuery('#of-option-about').load('about.php')
jQuery('#of-option-upgrade').load('upgrade.php')
});

In header.php line 8 change (thanks to Arne for this update) :

<link rel="stylesheet" media="only screen and (max-width: 480px)" href="<?php echo get_template_directory_uri();?>/mobile.css" />

to:

<link rel="stylesheet" media="only screen and (max-width: 480px)" href="<?php echo get_stylesheet_directory_uri();?>/mobile.css" />

That should do it.