123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- <?php
- if ( ! function_exists( 'dw_setup' ) ):
- function dw_setup() {
- require( get_template_directory() . '/inc/utils.php' );
- require( get_template_directory() . '/inc/template.php' );
- require( get_template_directory() . '/inc/tweaks.php' );
- if ( ! isset( $content_width ) ) $content_width = 1310;
- add_theme_support( 'automatic-feed-links' );
- add_theme_support( 'menus' );
- add_theme_support( 'post-thumbnails' );
- add_theme_support( 'html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption' ) );
- add_theme_support( 'post-formats', array( 'aside', 'gallery', 'image', 'video', 'audio', 'quote', 'link', 'status', 'chat' ) );
- set_post_thumbnail_size( 150, 150, true );
- add_image_size( 'post-large', 770, 577, true );
- add_image_size( 'studio', 400, 300, true );
- }
- endif;
- add_action( 'after_setup_theme', 'dw_setup' );
- if ( ! function_exists( 'dw_plugs' ) ):
- function dw_plugs() {
- if (!class_exists('dw_smtp')) {
- include_once(TEMPLATEPATH.'/inc/smtp.php');
- }
- if (!class_exists('dw_crumbs')) {
- //include_once(TEMPLATEPATH.'/inc/crumbs.php');
- }
- }
- endif;
- function dw_editor() {
- //add_editor_style( 'style.css' );
- }
- add_action( 'init', 'dw_editor' );
- add_action( 'wp_enqueue_scripts', 'dw_scripts' );
- function dw_scripts() {
- global $post;
- wp_enqueue_style( 'style', get_stylesheet_uri() );
- //wp_enqueue_style( 'style-min', get_template_directory_uri() . '/css/style.min.css');
- //wp_enqueue_style( 'style-o', get_template_directory_uri() . '/css/style-o.css');
- //wp_enqueue_style( 'style-o-min', get_template_directory_uri() . '/css/style-o.min.css');
- wp_enqueue_style( 'boots', get_template_directory_uri() . '/css/boot.css');
-
- wp_deregister_script('jquery');
-
- if ( is_page('about') ) {
- wp_enqueue_style( 'boot', get_template_directory_uri() . '/css/boot.css');
- wp_enqueue_style( 'cal', get_template_directory_uri() . '/css/fullcalendar.css');
- wp_enqueue_style( 'ani', get_template_directory_uri() . '/css/animate.css');
- wp_enqueue_script('jquery', get_template_directory_uri() . '/js/jquery-2.1.1.min.js', array(), false, true);
- wp_enqueue_script( 'modern', get_template_directory_uri() . '/js/modernizr.js', 'jquery', '', true );
- wp_enqueue_script( 'boostrap', get_template_directory_uri() . '/js/bootstrap.min.js', 'jquery', '', true );
- wp_enqueue_script( 'offcanvas', get_template_directory_uri() . '/js/jasny-bootstrap.js', 'jquery', '', true );
- wp_enqueue_script( 'time', get_template_directory_uri() . '/js/moment.min.js', 'jquery', '', true );
- wp_enqueue_script( 'cal', get_template_directory_uri() . '/js/fullcalendar.min.js', 'jquery', '', true );
- wp_enqueue_script( 'valid', get_template_directory_uri() . '/js/validate.min.js', 'jquery', '', true );
- wp_enqueue_script( 'smooth', get_template_directory_uri() . '/js/smooth.js', 'jquery', '', true );
- wp_enqueue_script( 'scripts', get_template_directory_uri() . '/js/scripts.js', 'jquery', '', true );
- //wp_enqueue_script( 'scriptmin', get_template_directory_uri() . '/js/script.min.js', 'jquery', '', true );
- wp_enqueue_script( 'init', get_template_directory_uri() . '/js/init.js', 'jquery', '', true );
- //wp_enqueue_script( 'init', get_template_directory_uri() . '/js/init.min.js', 'jquery', '', true );
- }
-
- elseif ( is_page('studio') ) {
- wp_enqueue_style( 'ani', get_template_directory_uri() . '/css/animate.css');
- wp_enqueue_script('jquery', get_template_directory_uri() . '/js/jquery-2.1.1.min.js', array(), false, true);
- wp_enqueue_script( 'modern', get_template_directory_uri() . '/js/modernizr.js', 'jquery', '', true );
- wp_enqueue_script( 'boostrap', get_template_directory_uri() . '/js/bootstrap.min.js', 'jquery', '', true );
- wp_enqueue_script( 'offcanvas', get_template_directory_uri() . '/js/jasny-bootstrap.js', 'jquery', '', true );
- wp_enqueue_script( 'scripts', get_template_directory_uri() . '/js/scripts.js', 'jquery', '', true );
- wp_enqueue_script( 'init', get_template_directory_uri() . '/js/studio.js', 'jquery', '', true );
- }
-
- elseif ( is_page('music') ) {
- //wp_enqueue_script( 'script-o', get_template_directory_uri() . '/js/script-o.js', 'jquery', '', true );
- wp_enqueue_script( 'script-o-min', get_template_directory_uri() . '/js/script-o.min.js', 'jquery', '', true );
- wp_enqueue_script( 'amp', get_template_directory_uri() . '/js/amp.min.js', 'jquery', '', true );
- wp_enqueue_script( 'chart', get_template_directory_uri() . '/js/chart.min.js', 'jquery', '', true );
- wp_enqueue_script( 'last-fm', get_template_directory_uri() . '/js/fm.js', 'jquery', '', true );
- }
-
- elseif ( is_page('art') ) {
- wp_enqueue_style( 'ani', get_template_directory_uri() . '/css/animate.css');
- wp_enqueue_script('jquery', get_template_directory_uri() . '/js/jquery-2.1.1.min.js', array(), false, true);
- wp_enqueue_script( 'modern', get_template_directory_uri() . '/js/modernizr.js', 'jquery', '', true );
- wp_enqueue_script( 'boostrap', get_template_directory_uri() . '/js/bootstrap.min.js', 'jquery', '', true );
- wp_enqueue_script( 'offcanvas', get_template_directory_uri() . '/js/jasny-bootstrap.js', 'jquery', '', true );
- wp_enqueue_script( 'scripts', get_template_directory_uri() . '/js/scripts.js', 'jquery', '', true );
- wp_enqueue_script( 'last-fm', get_template_directory_uri() . '/js/art.js', 'jquery', '', true );
- }
-
- elseif ( is_page('contact') ) {
- require( get_template_directory() . '/inc/form.php' );
- //gravity_form_enqueue_scripts(1, false);
- wp_enqueue_style( 'forms', get_template_directory_uri() . '/css/form.css');
- wp_enqueue_script('jquery', get_template_directory_uri() . '/js/jquery-2.1.1.min.js', array(), false, true);
- //wp_enqueue_script( 'script-o', get_template_directory_uri() . '/js/script-o.js', '', '', true );
- wp_enqueue_script( 'form', get_template_directory_uri() . '/js/form.js', '', '', true );
- }
- elseif ( is_page('analytics') ) {
- require( get_template_directory() . '/inc/analytics.php' );
- wp_enqueue_style( 'dashboard', get_template_directory_uri() . '/css/analytics.css');
- wp_enqueue_script('jquery', get_template_directory_uri() . '/js/jquery-2.1.1.min.js', array(), false, true);
- //wp_enqueue_script( 'script-o', get_template_directory_uri() . '/js/script-o.js', '', '', true );
- wp_enqueue_script( 'dashboardjs', get_template_directory_uri() . '/js/analytics.js', '', '', true );
- }
-
- elseif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
- wp_enqueue_script( 'jquery', get_template_directory_uri() . '/js/script-o.js', '', '', true );
- wp_enqueue_script( 'init-o', get_template_directory_uri() . '/js/init-o.js', '', '', true );
- wp_enqueue_script( 'comment-reply' );
- }
-
- elseif ( is_page('desk') || is_archive() || is_search() ) {
- global $wp_rewrite;
- //wp_enqueue_script( 'jquery', get_template_directory_uri() . '/js/jquery-2.1.1.min.js', array(), false, true); //jquery dependents
- wp_enqueue_style( 'ani', get_template_directory_uri() . '/css/animate.css');
- wp_enqueue_script('jquery', get_template_directory_uri() . '/js/jquery-2.1.1.min.js', array(), false, true);
- wp_enqueue_script( 'modern', get_template_directory_uri() . '/js/modernizr.js', 'jquery', '', true );
- wp_enqueue_script( 'boostrap', get_template_directory_uri() . '/js/bootstrap.min.js', 'jquery', '', true );
- wp_enqueue_script( 'offcanvas', get_template_directory_uri() . '/js/jasny-bootstrap.js', 'jquery', '', true );
- wp_enqueue_script( 'scripts', get_template_directory_uri() . '/js/scripts.js', 'jquery', '', true );
- wp_enqueue_script( 'desk', get_template_directory_uri() . '/js/desk.js', '', '', true );
- wp_enqueue_script( '_s_backbone-loop', get_template_directory_uri() . '/js/loop.js', array( 'jquery', 'backbone', 'underscore', 'wp-api' ), '1.0', true );
- $queried_object = get_queried_object();
- $local = array(
- 'loopType' => 'home',
- 'queriedObject' => $queried_object,
- 'pathInfo' => array(
- 'author_permastruct' => $wp_rewrite->get_author_permastruct(),
- 'host' => preg_replace( '#^http(s)?://#i', '', untrailingslashit( home_url() ) ),
- 'path' => _s_backbone_get_request_path(),
- 'use_trailing_slashes' => $wp_rewrite->use_trailing_slashes,
- 'parameters' => _s_backbone_get_request_parameters(),
- ),
- );
- if ( is_category() || is_tag() || is_tax() ) {
- $local['loopType'] = 'archive';
- $local['taxonomy'] = get_taxonomy( $queried_object->taxonomy );
- } elseif ( is_search() ) {
- $local['loopType'] = 'search';
- $local['searchQuery'] = get_search_query();
- } elseif ( is_author() ) {
- $local['loopType'] = 'author';
- }
- if ( is_paged() ) {
- $local['page'] = absint( get_query_var( 'paged' ) ) + 1;
- }
- wp_localize_script( '_s_backbone-loop', 'settings', $local );
- }
-
- else {
- wp_enqueue_script( 'script-o', get_template_directory_uri() . '/js/script-o.js', '', '', true );
- //wp_enqueue_script( 'script-o-min', get_template_directory_uri() . '/js/script-o.min.js', 'jquery', '', true );
- wp_enqueue_script( 'init-o', get_template_directory_uri() . '/js/init-o.js', '', '', true );
- //wp_enqueue_script( 'init-o-min', get_template_directory_uri() . '/js/init-o.min.js', 'jquery', '', true );
- }
-
- }
- add_action('wp_footer', 'dw_html5shim', 21);
- function dw_html5shim() { ?>
- <!--[if lt IE 9]><script src="<?php echo get_template_directory_uri() . '/js/html5shiv.min.js'?>"></script><![endif]-->
- <?php }
-
- add_action('wp_footer', 'dw_analytics', 22);
- function dw_analytics() { ?>
- <script>
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
- })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
- ga('create', 'UA-1906067-6', 'davidawindham.com');
- ga('send', 'pageview');
- var _paq = _paq || [];
- _paq.push(['trackPageView']);
- _paq.push(['enableLinkTracking']);
- (function() {
- var u="//davidawindham.com/wik/";
- _paq.push(['setTrackerUrl', u+'piwik.php']);
- _paq.push(['setSiteId', 1]);
- var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
- g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
- })();
- </script>
- <noscript><p><img src="//davidawindham.com/wik/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
- <?php }
- ?>
|