/** * Register backend scripts and stylesheets. **/ function enqueue_backend_theme_assets() { // Register Config css, js foreach (Config::$styles as $style) { if (isset($style['admin']) && $style['admin'] == true) { Config::add_css($style); } } foreach (Config::$scripts as $script) { if (isset($script['admin']) && $script['admin'] == true) { Config::add_script($script); } } }
/** * Responsible for running code that needs to be executed as wordpress is * initializing. Good place to register scripts, stylesheets, theme elements, * etc. * * @return void * @author Jared Lang **/ function __init__() { add_theme_support('menus'); add_theme_support('post-thumbnails'); add_image_size('homepage', 620); add_image_size('single-post-thumbnail', 220, 230, true); register_nav_menu('header-menu', __('Header Menu')); register_nav_menu('footer-menu', __('Footer Menu')); register_sidebar(array('name' => __('Sidebar'), 'id' => 'sidebar', 'description' => 'Sidebar found on two column page templates and search pages', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>')); /* register_sidebar(array( 'name' => __('Below the Fold - Left'), 'id' => 'bottom-left', 'description' => 'Left column on the bottom of pages, after flickr images if enabled.', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', )); register_sidebar(array( 'name' => __('Below the Fold - Center'), 'id' => 'bottom-center', 'description' => 'Center column on the bottom of pages, after news if enabled.', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', )); register_sidebar(array( 'name' => __('Below the Fold - Right'), 'id' => 'bottom-right', 'description' => 'Right column on the bottom of pages, after events if enabled.', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', ));*/ register_sidebar(array('name' => __('Footer - Column One'), 'id' => 'bottom-one', 'description' => 'Far left column in footer on the bottom of pages.', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>')); register_sidebar(array('name' => __('Footer - Column Two'), 'id' => 'bottom-two', 'description' => 'Second column from the left in footer, on the bottom of pages.', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>')); register_sidebar(array('name' => __('Footer - Column Three'), 'id' => 'bottom-three', 'description' => 'Third column from the left in footer, on the bottom of pages.', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>')); register_sidebar(array('name' => __('Footer - Column Four'), 'id' => 'bottom-four', 'description' => 'Far right in footer on the bottom of pages.', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>')); foreach (Config::$styles as $style) { Config::add_css($style); } foreach (Config::$scripts as $script) { Config::add_script($script); } global $timer; $timer = Timer::start(); wp_deregister_script('l10n'); set_defaults_for_options(); }
function enqueue_issue_story_scripts() { global $post; if ($post->post_type == 'issue' && ($javascript_url = Issue::get_javascript_url($post)) !== False) { Config::add_script($javascript_url); } else { if ($post->post_type == 'story' && ($javascript_url = Story::get_javascript_url($post)) !== False) { if (($issue = get_story_issue($post)) !== False && ($issue_javascript_url = Issue::get_javascript_url($issue)) !== False) { Config::add_script($issue_javascript_url); } Config::add_script($javascript_url); } } }