/** * Initializes K2 * * @uses do_action() Provides 'k2_init' action */ function init() { // Loads localisation from K2's languages directory load_theme_textdomain('unwakeable', TEMPLATEPATH . '/languages'); // Load required classes and includes require_once TEMPLATEPATH . '/app/includes/wp-compat.php'; require_once TEMPLATEPATH . '/app/classes/archive.php'; require_once TEMPLATEPATH . '/app/includes/info.php'; require_once TEMPLATEPATH . '/app/includes/display.php'; require_once TEMPLATEPATH . '/app/includes/comments.php'; if (class_exists('WP_Widget')) { // WP 2.8+ require_once TEMPLATEPATH . '/app/includes/widgets.php'; } if (defined('K2_STYLES') and K2_STYLES == true) { require_once TEMPLATEPATH . '/app/classes/styles.php'; } if (defined('K2_HEADERS') and K2_HEADERS == true) { require_once TEMPLATEPATH . '/app/classes/header.php'; } // Check installed version, upgrade if needed $unwakeable_version = get_option('unwakeable_version'); if ($unwakeable_version === false) { K2::install(); } elseif (version_compare($unwakeable_version, K2_CURRENT, '<')) { K2::upgrade($unwakeable_version); } // Register our scripts with script loader K2::register_scripts(); // There may be some things we need to do before K2 is initialised // Let's do them now do_action('k2_init'); // Finally load pluggable functions require_once TEMPLATEPATH . '/app/includes/pluggable.php'; // Register our sidebars with widgets k2_register_sidebars(); // Register the fact that K2 supports post-thumbnails if (function_exists('add_theme_support')) { add_theme_support('post-thumbnails'); } // Automatically output feed links. Requires WP 2.8+ add_theme_support('automatic-feed-links'); }
<?php // Load localizatons load_theme_textdomain('k2_domain'); // Register our scripts with script loader K2::register_scripts(); // Load our scripts wp_enqueue_script('k2functions'); if (get_option('k2rollingarchives') == 1) { wp_enqueue_script('k2rollingarchives'); } if (get_option('k2livesearch') == 1) { wp_enqueue_script('k2livesearch'); } if (get_option('k2livecommenting') == 1 and ((is_page() or is_single()) and !isset($_GET['jal_edit_comments']) and 'open' == $post->comment_status or 'comment' == $post->comment_type)) { wp_enqueue_script('k2comments'); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?> > <head profile="http://gmpg.org/xfn/11"> <title><?php // Page or Single Post if (is_page() or is_single()) { the_title(); // Category Archive } elseif (is_category()) {
function module_admin_scripts() { // Register our scripts K2::register_scripts(); // Add our script to the queue wp_enqueue_script('k2sbm'); }