Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Initiate Theme Options
- *
- * @uses wp_deregister_script()
- * @uses wp_register_script()
- * @uses wp_enqueue_script()
- * @uses register_nav_menus()
- * @uses add_theme_support()
- * @uses is_admin()
- *
- * @access public
- * @since 1.0.0
- *
- * @return void
- * Ok, Now that's out of the way, let's rock and roll!
- */
- /* Define our theme URL constant */
- if(!defined('WP_THEME_URL')) {
- define( 'WP_THEME_URL', get_bloginfo('stylesheet_directory'));
- }
- /* OPTION TREE */
- add_filter( 'ot_show_pages', '__return_false' );
- add_filter( 'ot_theme_mode', '__return_true' );
- include_once( 'option-tree/ot-loader.php' );
- include_once( 'functions/theme-options.php' );
- function ot_custom_style(){
- wp_register_style( 'custom_wp_admin_css', get_stylesheet_directory_uri() . '/functions/custom-option-tree/option-tree-custom.css', false, '1.0.0' );
- wp_enqueue_style( 'custom_wp_admin_css' );
- }
- add_action('admin_head', 'ot_custom_style');
- /* Load Theme Specific Widgets, Shortcodes, the ability to pull custom fields on the frontend, and our custom meta-boxes for the theme */
- include('functions/widgets/search_widget.php');
- include('functions/widgets/social_widget.php');
- include('functions/shortcodes.php');
- include('functions/custom-field.php');
- include_once 'functions/meta-box/meta-box-3.2.2.class.php';
- include 'functions/meta-box/meta-box-usage.php';
- /* Activate Our Theme Widgets */
- add_action('widgets_init', create_function('', 'return register_widget("SearchWidget");'));
- add_action('widgets_init', create_function('', 'return register_widget("SocialWidget");'));
- /** IMAGE RESIZE */
- include_once( 'functions/image_resize.php' );
- /* Our Master Function: Does 2 Main things
- * If inside the admin panel, load up our custom style
- * If outside the admin panel, register/enqueue our theme scripts, nav areas, and widget areas.
- */
- function init_mdnw() {
- /* Register all scripts, Nav Areas, and Widget Areas */
- if(!is_admin()){
- /* Register all scripts */
- wp_deregister_script( 'jquery' );
- wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js');
- wp_enqueue_script( 'jquery' );
- wp_register_script( 'jQueryEasing', WP_THEME_URL . '/assets/js/jquery.easing.js');
- wp_enqueue_script( 'jQueryEasing' );
- //wp_register_script( 'Tipsy', WP_THEME_URL . '/assets/js/jquery.tipsy.js');
- //wp_enqueue_script( 'Tipsy' );
- wp_register_script( 'prettyPhoto', WP_THEME_URL . '/assets/js/jquery.prettyPhoto.js');
- wp_enqueue_script( 'prettyPhoto' );
- wp_register_script( 'Cufon', WP_THEME_URL . '/assets/js/cufon.js');
- wp_enqueue_script( 'Cufon' );
- wp_register_script( 'HoverIntent', WP_THEME_URL . '/assets/js/jquery.hoverIntent.js');
- wp_enqueue_script( 'HoverIntent' );
- wp_register_script( 'Dropdown', WP_THEME_URL . '/assets/js/superfish.js');
- wp_enqueue_script( 'Dropdown' );
- wp_register_script( 'ScreenSpire', WP_THEME_URL . '/assets/js/artboard.js');
- wp_enqueue_script( 'ScreenSpire' );
- wp_register_script( 'textualizer', get_template_directory_uri() . '/assets/js/textualizer.js',
- array('jquery'), false, true);
- wp_enqueue_script( 'textualizer');
- }
- /* Register Navigation */
- register_nav_menus( array(
- 'topbar' => __( 'Top Bar Menu', 'Top Bar Menu' ),
- 'footer' => __( 'Footer Menu', 'Footer Menu' ),
- ) );
- /* Register Primary Sidebar - USE WITH RAIL
- register_sidebar( array(
- 'name' => __( 'Primary Widget Area' ),
- 'id' => 'primary-widget-area',
- 'description' => __( 'The primary widget area'),
- 'before_widget' => '<li id="%1$s" class="widget %2$s">',
- 'after_widget' => '</li>',
- 'before_title' => '<h2 class="widget-title">',
- 'after_title' => '</h2>',
- ) ); */
- /* Register Secondary Sidebar (Right side, next to posts/pages) */
- register_sidebar( array(
- 'name' => __( 'Default Post/Page Sidebar' ),
- 'id' => 'default-widget-area',
- 'description' => __( 'Default widget area for posts/pages. ' ),
- 'before_widget' => '<li id="%1$s" class="widget %2$s">',
- 'after_widget' => '</li>',
- 'before_title' => '<h2 class="widget-title">',
- 'after_title' => '</h2>',
- ) );
- /* Register Footer Widgets */
- register_sidebar( array(
- 'name' => __( 'Footer Column 1' ),
- 'id' => 'footer-widget-1',
- 'description' => __( 'The first column in the footer widget area.' ),
- 'before_widget' => '<li id="%1$s" class="widget %2$s">',
- 'after_widget' => '</li>',
- 'before_title' => '<h2 class="widget-title">',
- 'after_title' => '</h2>',
- ) );
- /* Register Footer Widgets */
- register_sidebar( array(
- 'name' => __( 'Footer Column 2' ),
- 'id' => 'footer-widget-2',
- 'description' => __( 'The second column in the footer widget area.' ),
- 'before_widget' => '<li id="%1$s" class="widget %2$s">',
- 'after_widget' => '</li>',
- 'before_title' => '<h2 class="widget-title">',
- 'after_title' => '</h2>',
- ) );
- /* Register Footer Widgets */
- register_sidebar( array(
- 'name' => __( 'Footer Column 3' ),
- 'id' => 'footer-widget-3',
- 'description' => __( 'The third column in the footer widget area.' ),
- 'before_widget' => '<li id="%1$s" class="widget %2$s">',
- 'after_widget' => '</li>',
- 'before_title' => '<h2 class="widget-title">',
- 'after_title' => '</h2>',
- ) );
- /* Register Footer Widgets */
- register_sidebar( array(
- 'name' => __( 'Footer Column 4' ),
- 'id' => 'footer-widget-4',
- 'description' => __( 'The fourth column in the footer widget area.' ),
- 'before_widget' => '<li id="%1$s" class="widget %2$s">',
- 'after_widget' => '</li>',
- 'before_title' => '<h2 class="widget-title">',
- 'after_title' => '</h2>',
- ) );
- }
- add_action('init', 'init_mdnw'); /* Run the above function at the init() hook */
- /* Add the Chosen script to the footer (for better <select> elements). */
- add_action('wp_print_scripts', 'chosen'); /* Run the above function at the wp_footer() hook */
- function chosen() {
- wp_enqueue_script( 'chosen', WP_THEME_URL . '/assets/js/chosen/chosen.jquery.js', array('jquery'), '0.9', true );
- }
- /* ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- */
- /* Required WP Theme Support */
- add_theme_support( 'automatic-feed-links' );
- add_theme_support('editor_style');
- add_editor_style('/assets/css/custom-editor.css');
- /* Add "Post Thumbnails" Support */
- add_theme_support( 'post-thumbnails' );
- set_post_thumbnail_size( 200, 200, true );
- /* Add comment-reply support */
- function theme_queue_js(){
- if (!is_admin()){
- if ( is_singular() AND comments_open() AND (get_option('thread_comments') == 1))
- wp_enqueue_script( 'comment-reply' );
- }
- }
- add_action('wp_print_scripts', 'theme_queue_js');
- /* Disable Page Comments */
- function noPgComments($open,$post_id) {
- if (get_post_type($post_id) == 'page') {
- $open = false;
- }
- return $open;
- }
- add_filter( 'comments_open', 'noPgComments', 10, 2 );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement