|
@@ -1,7 +1,5 @@
|
|
|
<?php
|
|
|
|
|
|
-add_filter( 'pre_http_request', '__return_true', 100 ); //REMOVE All REMOTE CAllS
|
|
|
-
|
|
|
if ( ! function_exists( 'dw_setup' ) ):
|
|
|
function dw_setup() {
|
|
|
require( get_template_directory() . '/inc/template.php' );
|
|
@@ -9,14 +7,24 @@ function dw_setup() {
|
|
|
require get_template_directory() . '/inc/utils.php';
|
|
|
}
|
|
|
endif;
|
|
|
-add_action( 'after_setup_theme', 'dw_setup' );
|
|
|
|
|
|
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' ) );
|
|
|
set_post_thumbnail_size( 150, 150, true );
|
|
|
add_image_size( 'post-large', 770, 577, true );
|
|
|
|
|
|
+if ( ! isset( $content_width ) ) $content_width = 1310;
|
|
|
+add_action( 'after_setup_theme', 'dw_setup' );
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+function dw_editor() {
|
|
|
+ add_editor_style( 'style.css' );
|
|
|
+}
|
|
|
+add_action( 'init', 'dw_editor' );
|
|
|
+
|
|
|
|
|
|
function dw_scripts() {
|
|
|
global $post;
|
|
@@ -67,26 +75,21 @@ function dw_scripts() {
|
|
|
|
|
|
|
|
|
|
|
|
- if ( is_page('notebook') || is_archive() || is_search() ) {
|
|
|
-
|
|
|
+ if ( is_page('notebook') || is_archive() || is_search() ) {
|
|
|
global $wp_rewrite;
|
|
|
-
|
|
|
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( get_option( 'home' ) ) ),
|
|
|
+ '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 );
|
|
@@ -96,21 +99,13 @@ function dw_scripts() {
|
|
|
} elseif ( is_author() ) {
|
|
|
$local['loopType'] = 'author';
|
|
|
}
|
|
|
-
|
|
|
- //set the page we're on so that Backbone can load the proper state
|
|
|
if ( is_paged() ) {
|
|
|
$local['page'] = absint( get_query_var( 'paged' ) ) + 1;
|
|
|
}
|
|
|
|
|
|
wp_localize_script( '_s_backbone-loop', 'settings', $local );
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
}
|
|
|
add_action( 'wp_enqueue_scripts', 'dw_scripts' );
|
|
|
|
|
|
-function dw_editor() {
|
|
|
- //add_editor_style( 'style.css' );
|
|
|
-}
|
|
|
-add_action( 'init', 'dw_editor' );
|
|
|
-
|
|
|
?>
|