| @@ -9,11 +9,11 @@ discard block | ||
| 9 | 9 | */ | 
| 10 | 10 | |
| 11 | 11 | // Set the content width based on the theme's design and stylesheet. | 
| 12 | -if ( ! isset( $content_width ) ) { | |
| 12 | +if ( ! isset($content_width)) { | |
| 13 | 13 | $content_width = 1920; | 
| 14 | 14 | } /* pixels */ | 
| 15 | 15 | |
| 16 | -if ( ! function_exists( 'strip_setup' ) ) : | |
| 16 | +if ( ! function_exists('strip_setup')) : | |
| 17 | 17 | /** | 
| 18 | 18 | * Sets up theme defaults and registers support for various WordPress features. | 
| 19 | 19 | * | 
| @@ -28,29 +28,29 @@ discard block | ||
| 28 | 28 | * adding custom login css | 
| 29 | 29 | * changing text in footer of admin | 
| 30 | 30 | */ | 
| 31 | - require_once( 'assets/admin.php' ); | |
| 31 | +		require_once('assets/admin.php'); | |
| 32 | 32 | /** | 
| 33 | 33 | * Make theme available for translation | 
| 34 | 34 | * Translations can be filed in the /languages/ directory | 
| 35 | 35 | * If you're building a theme based on strip, use a find and replace | 
| 36 | 36 | * to change 'strip' to the name of your theme in all the template files | 
| 37 | 37 | */ | 
| 38 | - load_theme_textdomain( 'strip', get_template_directory() . '/languages' ); | |
| 38 | +		load_theme_textdomain('strip', get_template_directory() . '/languages'); | |
| 39 | 39 | |
| 40 | 40 | // Add default posts and comments RSS feed links to head. | 
| 41 | - add_theme_support( 'automatic-feed-links' ); | |
| 41 | +		add_theme_support('automatic-feed-links'); | |
| 42 | 42 | |
| 43 | 43 | /** | 
| 44 | 44 | * Enable support for title-tag. Allows themes to add document title tag to HTML <head> (since version 4.1.). | 
| 45 | 45 | */ | 
| 46 | - add_theme_support( 'title-tag' ); | |
| 46 | +		add_theme_support('title-tag'); | |
| 47 | 47 | |
| 48 | 48 | /** | 
| 49 | 49 | * Enable support for custom logo. | 
| 50 | 50 | * | 
| 51 | 51 | * @since strip 1.0 | 
| 52 | 52 | */ | 
| 53 | - add_theme_support( 'custom-logo', array( | |
| 53 | +		add_theme_support('custom-logo', array( | |
| 54 | 54 | 'height' => 156, | 
| 55 | 55 | 'width' => 312, | 
| 56 | 56 | 'flex-height' => true, | 
| @@ -63,11 +63,11 @@ discard block | ||
| 63 | 63 | * | 
| 64 | 64 | * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ | 
| 65 | 65 | */ | 
| 66 | - add_theme_support( 'post-thumbnails' ); | |
| 67 | - add_image_size( 'stri-featured-image', 1920, 960, true ); | |
| 68 | - add_image_size( 'strip-large', 1920, 960, true ); // cropped. | |
| 69 | - add_image_size( 'strip-medium', 624, 312, true ); // cropped. | |
| 70 | - add_image_size( 'strip-thumbnail', 312, 156, true ); // cropped. | |
| 66 | +		add_theme_support('post-thumbnails'); | |
| 67 | +		add_image_size('stri-featured-image', 1920, 960, true); | |
| 68 | +		add_image_size('strip-large', 1920, 960, true); // cropped. | |
| 69 | +		add_image_size('strip-medium', 624, 312, true); // cropped. | |
| 70 | +		add_image_size('strip-thumbnail', 312, 156, true); // cropped. | |
| 71 | 71 | |
| 72 | 72 | /** | 
| 73 | 73 | * Remove paragraph tags around images. | 
| @@ -78,35 +78,35 @@ discard block | ||
| 78 | 78 | * @see http://codex.wordpress.org/Function_Reference/wpautop gets the same result | 
| 79 | 79 | * but it removes line blocks: remove_filter( 'the_content', 'wpautop' ); | 
| 80 | 80 | */ | 
| 81 | -		function filter_ptags_on_images( $content ) { | |
| 82 | - return preg_replace( '/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content ); | |
| 81 | +		function filter_ptags_on_images($content) { | |
| 82 | +			return preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content); | |
| 83 | 83 | } | 
| 84 | - add_filter( 'the_content', 'filter_ptags_on_images' ); | |
| 84 | +		add_filter('the_content', 'filter_ptags_on_images'); | |
| 85 | 85 | |
| 86 | 86 | /** | 
| 87 | 87 | * This theme uses wp_nav_menu() in one location. | 
| 88 | 88 | */ | 
| 89 | 89 | register_nav_menus(array( | 
| 90 | - 'primary' => __( 'Primary Menu', 'strip' ), | |
| 90 | +			'primary' => __('Primary Menu', 'strip'), | |
| 91 | 91 | )); | 
| 92 | 92 | |
| 93 | 93 | /* | 
| 94 | 94 | * Switch default core markup for search form, comment form, and comments | 
| 95 | 95 | * to output valid HTML5. | 
| 96 | 96 | */ | 
| 97 | - add_theme_support( 'html5', array( | |
| 97 | +		add_theme_support('html5', array( | |
| 98 | 98 | 'search-form', | 
| 99 | 99 | 'comment-form', | 
| 100 | 100 | 'comment-list', | 
| 101 | 101 | 'gallery', | 
| 102 | 102 | 'caption', | 
| 103 | 103 | 'widgets', | 
| 104 | - ) ); | |
| 104 | + )); | |
| 105 | 105 | |
| 106 | 106 | /** | 
| 107 | 107 | * Enable support for Post Formats | 
| 108 | 108 | */ | 
| 109 | - add_theme_support( 'post-formats', array( | |
| 109 | +		add_theme_support('post-formats', array( | |
| 110 | 110 | 'image', | 
| 111 | 111 | 'video', | 
| 112 | 112 | 'quote', | 
| @@ -114,13 +114,13 @@ discard block | ||
| 114 | 114 | 'gallery', | 
| 115 | 115 | 'audio', | 
| 116 | 116 | 'chat', | 
| 117 | - ) ); | |
| 117 | + )); | |
| 118 | 118 | |
| 119 | 119 | // Setup the WordPress core custom background feature. | 
| 120 | 120 |  		add_theme_support('custom-background', apply_filters('strip_custom_background_args', array( | 
| 121 | 121 | 'default-color' => 'ffffff', | 
| 122 | 122 | 'default-image' => '', | 
| 123 | - ) ) ); | |
| 123 | + ))); | |
| 124 | 124 | } | 
| 125 | 125 | |
| 126 | 126 | /** | 
| @@ -130,22 +130,22 @@ discard block | ||
| 130 | 130 | * @link: http://cubiq.org/clean-up-and-optimize-wordpress-for-your-next-theme | 
| 131 | 131 | */ | 
| 132 | 132 |  	function strip_cleanup() { | 
| 133 | - remove_action( 'wp_head', 'wp_generator' ); // WP Version. | |
| 134 | - remove_action( 'wp_head', 'wlwmanifest_link' ); | |
| 135 | - remove_action( 'wp_head', 'rsd_link' ); | |
| 136 | - remove_action( 'wp_head', 'rel_canonical', 10, 0 ); | |
| 137 | - remove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 ); | |
| 133 | +			remove_action('wp_head', 'wp_generator'); // WP Version. | |
| 134 | +			remove_action('wp_head', 'wlwmanifest_link'); | |
| 135 | +			remove_action('wp_head', 'rsd_link'); | |
| 136 | +			remove_action('wp_head', 'rel_canonical', 10, 0); | |
| 137 | +			remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0); | |
| 138 | 138 | |
| 139 | - remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );// Parent rel link. | |
| 140 | - remove_action( 'wp_head', 'start_post_rel_link', 10, 0 ); // Start post rel link. | |
| 141 | - remove_action( 'wp_head', 'index_rel_link' ); | |
| 139 | +			remove_action('wp_head', 'parent_post_rel_link', 10, 0); // Parent rel link. | |
| 140 | +			remove_action('wp_head', 'start_post_rel_link', 10, 0); // Start post rel link. | |
| 141 | +			remove_action('wp_head', 'index_rel_link'); | |
| 142 | 142 | |
| 143 | - remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 ); // Adjacent post rel link. | |
| 143 | +			remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0); // Adjacent post rel link. | |
| 144 | 144 | |
| 145 | - add_filter( 'the_generator', '__return_false' ); | |
| 145 | +			add_filter('the_generator', '__return_false'); | |
| 146 | 146 | |
| 147 | - remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); | |
| 148 | - remove_action( 'wp_print_styles', 'print_emoji_styles' ); | |
| 147 | +			remove_action('wp_head', 'print_emoji_detection_script', 7); | |
| 148 | +			remove_action('wp_print_styles', 'print_emoji_styles'); | |
| 149 | 149 | } | 
| 150 | 150 | /** | 
| 151 | 151 | * Cleanup head remove rss version | 
| @@ -161,8 +161,8 @@ discard block | ||
| 161 | 161 | * @param array $headers remove x pingback. | 
| 162 | 162 | * @since 1.1.3 | 
| 163 | 163 | */ | 
| 164 | -	function strip_remove_x_pingback( $headers ) { | |
| 165 | - unset( $headers['X-Pingback'] ); | |
| 164 | +	function strip_remove_x_pingback($headers) { | |
| 165 | + unset($headers['X-Pingback']); | |
| 166 | 166 | return $headers; | 
| 167 | 167 | } | 
| 168 | 168 | |
| @@ -173,11 +173,11 @@ discard block | ||
| 173 | 173 | */ | 
| 174 | 174 |  	function strip_remove_comments_inline_styles() { | 
| 175 | 175 | global $wp_widget_factory; | 
| 176 | -		if ( has_filter( 'wp_head', 'wp_widget_recent_comments_style' ) ) { | |
| 177 | - remove_filter( 'wp_head', 'wp_widget_recent_comments_style' ); | |
| 176 | +		if (has_filter('wp_head', 'wp_widget_recent_comments_style')) { | |
| 177 | +			remove_filter('wp_head', 'wp_widget_recent_comments_style'); | |
| 178 | 178 | } | 
| 179 | 179 | |
| 180 | - remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) ); | |
| 180 | +		remove_action('wp_head', array($wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style')); | |
| 181 | 181 | } | 
| 182 | 182 | |
| 183 | 183 | |
| @@ -185,22 +185,22 @@ discard block | ||
| 185 | 185 | * This theme styles the visual editor to resemble the theme style, | 
| 186 | 186 | * specifically font, colors, icons, and column width. | 
| 187 | 187 | */ | 
| 188 | - add_editor_style( array( '/assets/css/editor-style.css', '/assets/fonts/fenix.css' ) ); | |
| 188 | +	add_editor_style(array('/assets/css/editor-style.css', '/assets/fonts/fenix.css')); | |
| 189 | 189 | |
| 190 | 190 | // Indicate widget sidebars can use selective refresh in the Customizer. | 
| 191 | 191 | // See https://make.wordpress.org/core/2016/03/22/implementing-selective-refresh-support-for-widgets/ for detail. | 
| 192 | - add_theme_support( 'customize-selective-refresh-widgets' ); | |
| 192 | +	add_theme_support('customize-selective-refresh-widgets'); | |
| 193 | 193 | endif; // strip_setup. | 
| 194 | -add_action( 'after_setup_theme', 'strip_setup' ); | |
| 194 | +add_action('after_setup_theme', 'strip_setup'); | |
| 195 | 195 | |
| 196 | 196 | /** | 
| 197 | 197 | * Register widgetized area and update sidebar with default widgets | 
| 198 | 198 | */ | 
| 199 | 199 |  function strip_widgets_init() { | 
| 200 | 200 | register_sidebar(array( | 
| 201 | - 'name' => __( 'Main Sidebar', 'strip' ), | |
| 201 | +		'name'          => __('Main Sidebar', 'strip'), | |
| 202 | 202 | 'id' => 'sidebar', | 
| 203 | - 'description' => __( 'The main body widget area', 'strip' ), | |
| 203 | +		'description'   => __('The main body widget area', 'strip'), | |
| 204 | 204 | 'before_widget' => '<aside id="%1$s" class="widget %2$s">', | 
| 205 | 205 | 'after_widget' => '</aside>', | 
| 206 | 206 | 'before_title' => '<h2 class="widget-title">', | 
| @@ -208,10 +208,10 @@ discard block | ||
| 208 | 208 | )); | 
| 209 | 209 | |
| 210 | 210 | // First footer widget area, located in the footer. Empty by default. | 
| 211 | - register_sidebar( array( | |
| 212 | - 'name' => __( 'First Footer Widget', 'strip' ), | |
| 211 | + register_sidebar(array( | |
| 212 | +		'name'          => __('First Footer Widget', 'strip'), | |
| 213 | 213 | 'id' => 'first-footer-widget', | 
| 214 | - 'description' => __( 'The first footer widget', 'strip' ), | |
| 214 | +		'description'   => __('The first footer widget', 'strip'), | |
| 215 | 215 | 'before_widget' => '<aside id="%1$s" class="widget %2$s">', | 
| 216 | 216 | 'after_widget' => '</aside>', | 
| 217 | 217 | 'before_title' => '<h3 class="widget-title">', | 
| @@ -220,9 +220,9 @@ discard block | ||
| 220 | 220 | |
| 221 | 221 | // Second Footer Widget Area, located in the footer. Empty by default. | 
| 222 | 222 | register_sidebar(array( | 
| 223 | - 'name' => __( 'Second Footer Widget', 'strip' ), | |
| 223 | +		'name'          => __('Second Footer Widget', 'strip'), | |
| 224 | 224 | 'id' => 'second-footer-widget', | 
| 225 | - 'description' => __( 'The second footer widget', 'strip' ), | |
| 225 | +		'description'   => __('The second footer widget', 'strip'), | |
| 226 | 226 | 'before_widget' => '<aside id="%1$s" class="widget %2$s">', | 
| 227 | 227 | 'after_widget' => '</aside>', | 
| 228 | 228 | 'before_title' => '<h3 class="widget-title">', | 
| @@ -231,9 +231,9 @@ discard block | ||
| 231 | 231 | |
| 232 | 232 | // Third Footer Widget Area, located in the footer. Empty by default. | 
| 233 | 233 | register_sidebar(array( | 
| 234 | - 'name' => __( 'Third Footer Widget', 'strip' ), | |
| 234 | +		'name'          => __('Third Footer Widget', 'strip'), | |
| 235 | 235 | 'id' => 'third-footer-widget', | 
| 236 | - 'description' => __( 'The third footer widget', 'strip' ), | |
| 236 | +		'description'   => __('The third footer widget', 'strip'), | |
| 237 | 237 | 'before_widget' => '<aside id="%1$s" class="widget %2$s">', | 
| 238 | 238 | 'after_widget' => '</aside>', | 
| 239 | 239 | 'before_title' => '<h3 class="widget-title">', | 
| @@ -242,9 +242,9 @@ discard block | ||
| 242 | 242 | |
| 243 | 243 | // Fourth Footer Widget Area, located in the footer. Empty by default. | 
| 244 | 244 | register_sidebar(array( | 
| 245 | - 'name' => __( 'Fourth Footer Widget', 'strip' ), | |
| 245 | +		'name'           => __('Fourth Footer Widget', 'strip'), | |
| 246 | 246 | 'id' => 'fourth-footer-widget', | 
| 247 | - 'description' => __( 'The fourth footer widget', 'strip' ), | |
| 247 | +		'description'    => __('The fourth footer widget', 'strip'), | |
| 248 | 248 | 'before_widget' => '<aside id="%1$s" class="widget %2$s">', | 
| 249 | 249 | 'after_widget' => '</aside>', | 
| 250 | 250 | 'before_title' => '<h3 class="widget-title">', | 
| @@ -252,7 +252,7 @@ discard block | ||
| 252 | 252 | )); | 
| 253 | 253 | |
| 254 | 254 | } | 
| 255 | -add_action( 'widgets_init', 'strip_widgets_init' ); | |
| 255 | +add_action('widgets_init', 'strip_widgets_init'); | |
| 256 | 256 | |
| 257 | 257 | /** | 
| 258 | 258 | * Handles JavaScript detection. | 
| @@ -264,47 +264,47 @@ discard block | ||
| 264 | 264 |  function strip_javascript_detection() { | 
| 265 | 265 |  	echo "<script>(function(html){html.className = html.className.replace(/\bno-js\b/,'js')})(document.documentElement);</script>\n"; | 
| 266 | 266 | } | 
| 267 | -add_action( 'wp_head', 'strip_javascript_detection', 0 ); | |
| 267 | +add_action('wp_head', 'strip_javascript_detection', 0); | |
| 268 | 268 | |
| 269 | 269 | /** | 
| 270 | 270 | * Enqueue_styles for custom fonts. | 
| 271 | 271 | */ | 
| 272 | 272 |  function strip_scripts() { | 
| 273 | 273 | // add custom font here if any. | 
| 274 | - wp_enqueue_style( 'fenix', get_template_directory_uri() . '/assets/fonts/fenix.css', array(), null ); | |
| 274 | +	wp_enqueue_style('fenix', get_template_directory_uri() . '/assets/fonts/fenix.css', array(), null); | |
| 275 | 275 | |
| 276 | - wp_enqueue_style( 'inconsolata', get_template_directory_uri() . '/assets/fonts/inconsolata.css', array(), null ); | |
| 276 | +	wp_enqueue_style('inconsolata', get_template_directory_uri() . '/assets/fonts/inconsolata.css', array(), null); | |
| 277 | 277 | |
| 278 | 278 | // Theme stylesheet. | 
| 279 | - wp_enqueue_style( 'strip-style', get_stylesheet_uri() ); | |
| 279 | +	wp_enqueue_style('strip-style', get_stylesheet_uri()); | |
| 280 | 280 | |
| 281 | 281 | // Load the Internet Explorer specific stylesheet. Conditional stylesheet — tested and works with IE9 on Windows7. | 
| 282 | - wp_enqueue_style( 'strip-ie', get_template_directory_uri() . 'assets/css/ie.css', array( 'strip-style' ), '20160305' ); | |
| 283 | - wp_style_add_data( 'strip-ie', 'conditional', 'lt IE 10' ); | |
| 282 | +	wp_enqueue_style('strip-ie', get_template_directory_uri() . 'assets/css/ie.css', array('strip-style'), '20160305'); | |
| 283 | +	wp_style_add_data('strip-ie', 'conditional', 'lt IE 10'); | |
| 284 | 284 | |
| 285 | -	if ( has_nav_menu( 'primary' ) ) { | |
| 286 | - wp_enqueue_script( 'strip-navigation', get_template_directory_uri() . '/assets/js/min/navigation-min.js', array(), '1.0', true ); | |
| 285 | +	if (has_nav_menu('primary')) { | |
| 286 | +		wp_enqueue_script('strip-navigation', get_template_directory_uri() . '/assets/js/min/navigation-min.js', array(), '1.0', true); | |
| 287 | 287 | } | 
| 288 | 288 | |
| 289 | 289 | // Load the html5 shiv. | 
| 290 | - wp_enqueue_script( 'strip-html5', get_template_directory_uri() . '/assets/js/min/html5-min.js', array(), '3.7.3' ); | |
| 291 | - wp_script_add_data( 'strip-html5', 'conditional', 'lt IE 9' ); | |
| 290 | +	wp_enqueue_script('strip-html5', get_template_directory_uri() . '/assets/js/min/html5-min.js', array(), '3.7.3'); | |
| 291 | +	wp_script_add_data('strip-html5', 'conditional', 'lt IE 9'); | |
| 292 | 292 | |
| 293 | - wp_enqueue_script( 'strip-skip-link-focus-fix', get_template_directory_uri() . '/assets/js/min/skip-link-focus-fix-min.js', array(), '1.0', true ); | |
| 293 | +	wp_enqueue_script('strip-skip-link-focus-fix', get_template_directory_uri() . '/assets/js/min/skip-link-focus-fix-min.js', array(), '1.0', true); | |
| 294 | 294 | |
| 295 | 295 | // toggle comments js. | 
| 296 | - wp_enqueue_script( 'strip-toggle-comments', get_template_directory_uri() . '/assets/js/min/toggle-comments-min.js', array( 'jquery' ), '1.2', true ); | |
| 296 | +	wp_enqueue_script('strip-toggle-comments', get_template_directory_uri() . '/assets/js/min/toggle-comments-min.js', array('jquery'), '1.2', true); | |
| 297 | 297 | |
| 298 | -	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { | |
| 299 | - wp_enqueue_script( 'comment-reply' ); | |
| 298 | +	if (is_singular() && comments_open() && get_option('thread_comments')) { | |
| 299 | +		wp_enqueue_script('comment-reply'); | |
| 300 | 300 | |
| 301 | -		if ( is_single() && wp_attachment_is_image() ) { | |
| 302 | - wp_enqueue_script( 'strip-keyboard-image-navigation', get_template_directory_uri() . '/assets/js/min/keyboard-image-navigation-min.js', array( 'jquery' ), '20160412', true ); | |
| 301 | +		if (is_single() && wp_attachment_is_image()) { | |
| 302 | +			wp_enqueue_script('strip-keyboard-image-navigation', get_template_directory_uri() . '/assets/js/min/keyboard-image-navigation-min.js', array('jquery'), '20160412', true); | |
| 303 | 303 | } | 
| 304 | 304 | } | 
| 305 | 305 | } | 
| 306 | 306 | |
| 307 | -add_action( 'wp_enqueue_scripts', 'strip_scripts' ); | |
| 307 | +add_action('wp_enqueue_scripts', 'strip_scripts'); | |
| 308 | 308 | |
| 309 | 309 | /** | 
| 310 | 310 | * Implement the Custom Header feature. | 
| @@ -331,14 +331,14 @@ discard block | ||
| 331 | 331 | */ | 
| 332 | 332 | require get_template_directory() . '/inc/jetpack.php'; | 
| 333 | 333 | |
| 334 | -add_action( 'wp_enqueue_scripts', 'enqueue_royal_sliders' ); | |
| 334 | +add_action('wp_enqueue_scripts', 'enqueue_royal_sliders'); | |
| 335 | 335 | /** | 
| 336 | 336 | * Register RoyalSLider | 
| 337 | 337 | */ | 
| 338 | 338 |  function enqueue_royal_sliders() { | 
| 339 | -	if ( function_exists( 'register_new_royalslider_files' ) ) { | |
| 339 | +	if (function_exists('register_new_royalslider_files')) { | |
| 340 | 340 |  		// you could try this: if ( is_single() && is_archive() ) { but you don't really need it. | 
| 341 | - register_new_royalslider_files( 1 ); // place register_new_royalslider_files function here, 1 is your slider's configuration number | |
| 341 | + register_new_royalslider_files(1); // place register_new_royalslider_files function here, 1 is your slider's configuration number | |
| 342 | 342 | // add } if use is_single etc. | 
| 343 | 343 | } | 
| 344 | 344 | } | 
| @@ -353,22 +353,22 @@ discard block | ||
| 353 | 353 |  function get_first_image() { | 
| 354 | 354 | global $post; | 
| 355 | 355 | $first_img = ''; | 
| 356 | - preg_match_all( '/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', do_shortcode( $post->post_content, 'gallery' ), $matches ); | |
| 357 | - $first_img = isset( $matches[1][0] ) ? $matches[1][0] : null; | |
| 356 | +	preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', do_shortcode($post->post_content, 'gallery'), $matches); | |
| 357 | + $first_img = isset($matches[1][0]) ? $matches[1][0] : null; | |
| 358 | 358 | |
| 359 | -	if ( empty( $first_img ) ) { | |
| 359 | +	if (empty($first_img)) { | |
| 360 | 360 | return get_template_directory_uri() . '/assets/images/empty.png'; // path to default image. | 
| 361 | 361 | } | 
| 362 | 362 | |
| 363 | 363 | // Now we have the $first_img but we want the thumbnail of that image. | 
| 364 | - $explode = explode( '.', $first_img ); | |
| 365 | - $count = count( $explode ); | |
| 364 | +		$explode = explode('.', $first_img); | |
| 365 | + $count = count($explode); | |
| 366 | 366 | $size = '-624x312'; // Panel ratio (2:1) 312x156 for lighther page, 624x312 for retina; use add_image_size() and Force Regenerate Thumbnails plugin when changing sizes. | 
| 367 | - $explode[ $count -2 ] = $explode[ $count -2 ] . '' . $size; | |
| 368 | - $thumb_img = implode( '.', $explode ); | |
| 367 | + $explode[$count - 2] = $explode[$count - 2] . '' . $size; | |
| 368 | +		$thumb_img = implode('.', $explode); | |
| 369 | 369 | return $thumb_img; | 
| 370 | 370 | } | 
| 371 | - add_filter( 'get_first_image', 'thumbnail' ); | |
| 371 | +	add_filter('get_first_image', 'thumbnail'); | |
| 372 | 372 | |
| 373 | 373 | /** | 
| 374 | 374 | * Register Custom Post Type for comics | 
| @@ -376,26 +376,26 @@ discard block | ||
| 376 | 376 |  function comic_post_type() { | 
| 377 | 377 | |
| 378 | 378 | $labels = array( | 
| 379 | - 'name' => _x( 'Comics', 'Post Type General Name', 'strip' ), | |
| 380 | - 'singular_name' => _x( 'Comic', 'Post Type Singular Name', 'strip' ), | |
| 381 | - 'menu_name' => _x( 'Comics', 'admin menu', 'strip' ), | |
| 382 | - 'name_admin_bar' => _x( 'Comic', 'add new on admin bar', 'strip' ), | |
| 383 | - 'archives' => __( 'Item Archives', 'strip' ), | |
| 384 | - 'attributes' => __( 'Item Attributes', 'strip' ), | |
| 385 | - 'parent_item_colon' => __( 'Parent Comic:', 'strip' ), | |
| 386 | - 'all_items' => __( 'All Comics', 'strip' ), | |
| 387 | - 'add_new_item' => __( 'Add New Comic', 'strip' ), | |
| 388 | - 'add_new' => __( 'Add New Comic', 'strip' ), | |
| 389 | - 'new_item' => __( 'New Comic', 'strip' ), | |
| 390 | - 'edit_item' => __( 'Edit Comic', 'strip' ), | |
| 391 | - 'update_item' => __( 'Update Comic', 'strip' ), | |
| 392 | - 'view_item' => __( 'View Comic', 'strip' ), | |
| 393 | - 'search_items' => __( 'Search Item', 'strip' ), | |
| 394 | - 'not_found' => __( 'No Comics found', 'strip' ), | |
| 395 | - 'not_found_in_trash' => __( 'No Comics found in Trash', 'strip' ), | |
| 396 | - 'items_list' => __( 'Comics list', 'strip' ), | |
| 397 | - 'items_list_navigation' => __( 'Comics list navigation', 'strip' ), | |
| 398 | - 'filter_items_list' => __( 'Filter Comics list', 'strip' ), | |
| 379 | +		'name'                       => _x('Comics', 'Post Type General Name', 'strip'), | |
| 380 | +		'singular_name'              => _x('Comic', 'Post Type Singular Name', 'strip'), | |
| 381 | +		'menu_name'                  => _x('Comics', 'admin menu', 'strip'), | |
| 382 | +		'name_admin_bar'             => _x('Comic', 'add new on admin bar', 'strip'), | |
| 383 | +		'archives'             			 => __('Item Archives', 'strip'), | |
| 384 | +		'attributes'           			 => __('Item Attributes', 'strip'), | |
| 385 | +		'parent_item_colon'	         => __('Parent Comic:', 'strip'), | |
| 386 | +		'all_items'                  => __('All Comics', 'strip'), | |
| 387 | +		'add_new_item'               => __('Add New Comic', 'strip'), | |
| 388 | +		'add_new'                    => __('Add New Comic', 'strip'), | |
| 389 | +		'new_item'                   => __('New Comic', 'strip'), | |
| 390 | +		'edit_item'                  => __('Edit Comic', 'strip'), | |
| 391 | +		'update_item'                => __('Update Comic', 'strip'), | |
| 392 | +		'view_item'                  => __('View Comic', 'strip'), | |
| 393 | +		'search_items'               => __('Search Item', 'strip'), | |
| 394 | +		'not_found'                  => __('No Comics found', 'strip'), | |
| 395 | +		'not_found_in_trash'         => __('No Comics found in Trash', 'strip'), | |
| 396 | +		'items_list'                 => __('Comics list', 'strip'), | |
| 397 | +		'items_list_navigation'      => __('Comics list navigation', 'strip'), | |
| 398 | +		'filter_items_list'          => __('Filter Comics list', 'strip'), | |
| 399 | 399 | ); | 
| 400 | 400 | |
| 401 | 401 | $supports = array( | 
| @@ -412,11 +412,11 @@ discard block | ||
| 412 | 412 | ); | 
| 413 | 413 | |
| 414 | 414 | $args = array( | 
| 415 | - 'label' => __( 'Comic', 'strip' ), | |
| 416 | - 'description' => __( 'Publish Comics and Webcomics', 'strip' ), | |
| 415 | +		'label'                      => __('Comic', 'strip'), | |
| 416 | +		'description'                => __('Publish Comics and Webcomics', 'strip'), | |
| 417 | 417 | 'labels' => $labels, | 
| 418 | 418 | 'supports' => $supports, | 
| 419 | - 'taxonomies' => array( 'story', 'story_term', 'draft' ), | |
| 419 | +		'taxonomies'                 => array('story', 'story_term', 'draft'), | |
| 420 | 420 | 'hierarchical' => true, | 
| 421 | 421 | 'public' => true, | 
| 422 | 422 | 'show_ui' => true, | 
| @@ -429,40 +429,40 @@ discard block | ||
| 429 | 429 | 'has_archive' => true, | 
| 430 | 430 | 'feeds' => true, | 
| 431 | 431 | 'exclude_from_search' => false, | 
| 432 | - 'rewrite' => array( 'slug' => 'stories', 'with_front' => true ), | |
| 432 | +		'rewrite'                    => array('slug' => 'stories', 'with_front' => true), | |
| 433 | 433 | 'publicly_queryable' => true, | 
| 434 | 434 | 'capability_type' => 'post', | 
| 435 | 435 | ); | 
| 436 | - register_post_type( 'comic', $args ); | |
| 436 | +	register_post_type('comic', $args); | |
| 437 | 437 | } | 
| 438 | 438 | |
| 439 | 439 | // Hook into the 'init' action. | 
| 440 | -add_action( 'init', 'comic_post_type', 0 ); // End of register_cpt_comic(). | |
| 440 | +add_action('init', 'comic_post_type', 0); // End of register_cpt_comic(). | |
| 441 | 441 | |
| 442 | 442 | /** | 
| 443 | 443 | * Register Custom Taxonomy 'story' | 
| 444 | 444 | */ | 
| 445 | 445 |  function comic_story_taxonomy() { | 
| 446 | 446 | $labels = array( | 
| 447 | - 'name' => _x( 'Comic Story', 'Taxonomy General Name', 'strip' ), | |
| 448 | - 'singular_name' => _x( 'Comic Story', 'Taxonomy Singular Name', 'strip' ), | |
| 449 | - 'menu_name' => __( 'Comic Stories', 'strip' ), | |
| 450 | - 'all_items' => __( 'All Comic Stories', 'strip' ), | |
| 451 | - 'parent_item' => __( 'Parent Story', 'strip' ), | |
| 452 | - 'parent_item_colon' => __( 'Parent Story:', 'strip' ), | |
| 453 | - 'new_item_name' => __( 'New Comic Story', 'strip' ), | |
| 454 | - 'add_new_item' => __( 'Add New Story', 'strip' ), | |
| 455 | - 'edit_item' => __( 'Edit Story', 'strip' ), | |
| 456 | - 'update_item' => __( 'Update Story', 'strip' ), | |
| 457 | - 'view_item' => __( 'View Item', 'strip' ), | |
| 458 | - 'separate_items_with_commas' => __( 'Separate stories with commas', 'strip' ), | |
| 459 | - 'add_or_remove_items' => __( 'Add or Remove Stories', 'strip' ), | |
| 460 | - 'choose_from_most_used' => __( 'Choose from the most used stories', 'strip' ), | |
| 461 | - 'popular_items' => __( 'Popular comic stories', 'strip' ), | |
| 462 | - 'search_items' => __( 'Search Stories', 'strip' ), | |
| 463 | - 'not_found' => __( 'No comic Stories found', 'strip' ), | |
| 464 | - 'items_list' => __( 'Comic Stories list', 'strip' ), | |
| 465 | - 'items_list_navigation' => __( 'Comic Stories list navigation', 'strip' ), | |
| 447 | +		'name'                       => _x('Comic Story', 'Taxonomy General Name', 'strip'), | |
| 448 | +		'singular_name'              => _x('Comic Story', 'Taxonomy Singular Name', 'strip'), | |
| 449 | +		'menu_name'                  => __('Comic Stories', 'strip'), | |
| 450 | +		'all_items'                  => __('All Comic Stories', 'strip'), | |
| 451 | +		'parent_item'                => __('Parent Story', 'strip'), | |
| 452 | +		'parent_item_colon'          => __('Parent Story:', 'strip'), | |
| 453 | +		'new_item_name'              => __('New Comic Story', 'strip'), | |
| 454 | +		'add_new_item'               => __('Add New Story', 'strip'), | |
| 455 | +		'edit_item'                  => __('Edit Story', 'strip'), | |
| 456 | +		'update_item'                => __('Update Story', 'strip'), | |
| 457 | +		'view_item'                  => __('View Item', 'strip'), | |
| 458 | +		'separate_items_with_commas' => __('Separate stories with commas', 'strip'), | |
| 459 | +		'add_or_remove_items'        => __('Add or Remove Stories', 'strip'), | |
| 460 | +		'choose_from_most_used'      => __('Choose from the most used stories', 'strip'), | |
| 461 | +		'popular_items'              => __('Popular comic stories', 'strip'), | |
| 462 | +		'search_items'               => __('Search Stories', 'strip'), | |
| 463 | +		'not_found'                  => __('No comic Stories found', 'strip'), | |
| 464 | +		'items_list'                 => __('Comic Stories list', 'strip'), | |
| 465 | +		'items_list_navigation'      => __('Comic Stories list navigation', 'strip'), | |
| 466 | 466 | ); | 
| 467 | 467 | $args = array( | 
| 468 | 468 | 'labels' => $labels, | 
| @@ -474,14 +474,14 @@ discard block | ||
| 474 | 474 | 'show_in_nav_menus' => true, | 
| 475 | 475 | 'show_tagcloud' => true, | 
| 476 | 476 | 'query_var' => true, | 
| 477 | - 'rewrite' => array( 'slug' => 'story' ), | |
| 477 | +		'rewrite'                    => array('slug' => 'story'), | |
| 478 | 478 | ); | 
| 479 | - register_taxonomy( 'story', array( 'comic' ), $args ); | |
| 480 | - register_taxonomy_for_object_type( 'story', 'comic' ); | |
| 479 | +	register_taxonomy('story', array('comic'), $args); | |
| 480 | +	register_taxonomy_for_object_type('story', 'comic'); | |
| 481 | 481 | } | 
| 482 | 482 | |
| 483 | 483 | // Hook into the 'init' action. | 
| 484 | -add_action( 'init', 'comic_story_taxonomy', 0 ); | |
| 484 | +add_action('init', 'comic_story_taxonomy', 0); | |
| 485 | 485 | |
| 486 | 486 | /** | 
| 487 | 487 | * Function strip rewrite rules. | 
| @@ -490,31 +490,31 @@ discard block | ||
| 490 | 490 | flush_rewrite_rules(); | 
| 491 | 491 | } | 
| 492 | 492 | /* Flush rewrite rules for custom post types. */ | 
| 493 | -add_action( 'after_switch_theme', 'strip_rewrite_rules' ); | |
| 493 | +add_action('after_switch_theme', 'strip_rewrite_rules'); | |
| 494 | 494 | |
| 495 | 495 | // Add Print taxonomy, NOT hierarchical (like tags) | 
| 496 | 496 | // Register Custom Taxonomy. | 
| 497 | 497 | $labels = array( | 
| 498 | - 'name' => _x( 'Prints', 'Taxonomy General Name', 'strip' ), | |
| 499 | - 'singular_name' => _x( 'Print', 'Taxonomy Singular Name', 'strip' ), | |
| 500 | - 'menu_name' => __( 'Print', 'strip' ), | |
| 501 | - 'all_items' => __( 'All Prints', 'strip' ), | |
| 502 | - 'parent_item' => __( 'Parent Print', 'strip' ), | |
| 503 | - 'parent_item_colon' => __( 'Parent Print:', 'strip' ), | |
| 504 | - 'new_item_name' => __( 'New Print Name', 'strip' ), | |
| 505 | - 'add_new_item' => __( 'Add New Print', 'strip' ), | |
| 506 | - 'edit_item' => __( 'Edit Print', 'strip' ), | |
| 507 | - 'update_item' => __( 'Update Pring', 'strip' ), | |
| 508 | - 'view_item' => __( 'View Print', 'strip' ), | |
| 509 | - 'separate_items_with_commas' => __( 'Separate prints with commas', 'strip' ), | |
| 510 | - 'add_or_remove_items' => __( 'Add or remove prints', 'strip' ), | |
| 511 | - 'choose_from_most_used' => __( 'Choose from the most used', 'strip' ), | |
| 512 | - 'popular_items' => __( 'Popular Prints', 'strip' ), | |
| 513 | - 'search_items' => __( 'Search Prints', 'strip' ), | |
| 514 | - 'not_found' => __( 'Not Found', 'strip' ), | |
| 515 | - 'no_terms' => __( 'No prints', 'strip' ), | |
| 516 | - 'items_list' => __( 'Prints list', 'strip' ), | |
| 517 | - 'items_list_navigation' => __( 'Prints list navigation', 'strip' ), | |
| 498 | +		'name'                       => _x('Prints', 'Taxonomy General Name', 'strip'), | |
| 499 | +		'singular_name'              => _x('Print', 'Taxonomy Singular Name', 'strip'), | |
| 500 | +		'menu_name'                  => __('Print', 'strip'), | |
| 501 | +		'all_items'                  => __('All Prints', 'strip'), | |
| 502 | +		'parent_item'                => __('Parent Print', 'strip'), | |
| 503 | +		'parent_item_colon'          => __('Parent Print:', 'strip'), | |
| 504 | +		'new_item_name'              => __('New Print Name', 'strip'), | |
| 505 | +		'add_new_item'               => __('Add New Print', 'strip'), | |
| 506 | +		'edit_item'                  => __('Edit Print', 'strip'), | |
| 507 | +		'update_item'                => __('Update Pring', 'strip'), | |
| 508 | +		'view_item'                  => __('View Print', 'strip'), | |
| 509 | +		'separate_items_with_commas' => __('Separate prints with commas', 'strip'), | |
| 510 | +		'add_or_remove_items'        => __('Add or remove prints', 'strip'), | |
| 511 | +		'choose_from_most_used'      => __('Choose from the most used', 'strip'), | |
| 512 | +		'popular_items'              => __('Popular Prints', 'strip'), | |
| 513 | +		'search_items'               => __('Search Prints', 'strip'), | |
| 514 | +		'not_found'                  => __('Not Found', 'strip'), | |
| 515 | +		'no_terms'                   => __('No prints', 'strip'), | |
| 516 | +		'items_list'                 => __('Prints list', 'strip'), | |
| 517 | +		'items_list_navigation'      => __('Prints list navigation', 'strip'), | |
| 518 | 518 | ); | 
| 519 | 519 | |
| 520 | 520 | $args = array( | 
| @@ -526,21 +526,21 @@ discard block | ||
| 526 | 526 | 'show_in_nav_menus' => true, | 
| 527 | 527 | 'show_tagcloud' => true, | 
| 528 | 528 | ); | 
| 529 | - register_taxonomy( 'print', array( 'comic' ), $args ); | |
| 529 | +	register_taxonomy('print', array('comic'), $args); | |
| 530 | 530 | |
| 531 | 531 | /* | 
| 532 | 532 | * WooCommerce Hooks | 
| 533 | 533 | * Layout | 
| 534 | 534 | */ | 
| 535 | - remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 ); | |
| 536 | - remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 ); | |
| 537 | - remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 ); | |
| 538 | - remove_action( 'woocommerce_after_shop_loop', 'woocommerce_pagination', 10 ); | |
| 539 | - remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 ); | |
| 540 | - remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 ); | |
| 535 | +	remove_action('woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0); | |
| 536 | +	remove_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10); | |
| 537 | +	remove_action('woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10); | |
| 538 | +	remove_action('woocommerce_after_shop_loop', 'woocommerce_pagination', 10); | |
| 539 | +	remove_action('woocommerce_before_shop_loop', 'woocommerce_result_count', 20); | |
| 540 | +	remove_action('woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30); | |
| 541 | 541 | |
| 542 | - add_action( 'woocommerce_before_main_content', 'strip_wrapper_start', 10 ); | |
| 543 | - add_action( 'woocommerce_after_main_content', 'strip_wrapper_end', 10 ); | |
| 542 | +	add_action('woocommerce_before_main_content', 'strip_wrapper_start', 10); | |
| 543 | +	add_action('woocommerce_after_main_content', 'strip_wrapper_end', 10); | |
| 544 | 544 | |
| 545 | 545 | /** | 
| 546 | 546 | * WooCommerce wrapper | 
| @@ -556,13 +556,13 @@ discard block | ||
| 556 | 556 | echo '</section>'; | 
| 557 | 557 | } | 
| 558 | 558 | |
| 559 | - add_action( 'after_setup_theme', 'woocommerce_support' ); | |
| 559 | +	add_action('after_setup_theme', 'woocommerce_support'); | |
| 560 | 560 | /** | 
| 561 | 561 | * Add WooCommerce support | 
| 562 | 562 | * https://docs.woothemes.com/document/third-party-custom-theme-compatibility/* | 
| 563 | 563 | */ | 
| 564 | 564 |  	function woocommerce_support() { | 
| 565 | - add_theme_support( 'woocommerce' ); | |
| 565 | +		add_theme_support('woocommerce'); | |
| 566 | 566 | } | 
| 567 | 567 | |
| 568 | 568 | /** | 
| @@ -570,13 +570,13 @@ discard block | ||
| 570 | 570 | */ | 
| 571 | 571 |  	function wp_enqueue_woocommerce_style() { | 
| 572 | 572 | |
| 573 | - wp_register_style( 'strip-woocommerce', get_template_directory_uri() . '/assets/css/woocommerce-min.css' ); | |
| 574 | -		if ( class_exists( 'woocommerce' ) ) { | |
| 575 | - wp_enqueue_style( 'strip-woocommerce' ); | |
| 573 | +			wp_register_style('strip-woocommerce', get_template_directory_uri() . '/assets/css/woocommerce-min.css'); | |
| 574 | +		if (class_exists('woocommerce')) { | |
| 575 | +			wp_enqueue_style('strip-woocommerce'); | |
| 576 | 576 | } | 
| 577 | 577 | } | 
| 578 | 578 | |
| 579 | - add_action( 'wp_enqueue_scripts', 'wp_enqueue_woocommerce_style' ); | |
| 579 | +	add_action('wp_enqueue_scripts', 'wp_enqueue_woocommerce_style'); | |
| 580 | 580 | |
| 581 | 581 | /** | 
| 582 | 582 | * Optimize WooCommerce Scripts | 
| @@ -587,53 +587,53 @@ discard block | ||
| 587 | 587 | * @link https://gist.github.com/DevinWalker/7621777 | 
| 588 | 588 | * @link http://dessky.com/blog/disable-woocommerce-scripts-and-styles/ | 
| 589 | 589 | */ | 
| 590 | - add_action( 'wp_enqueue_scripts', 'strip_manage_woocommerce_styles', 99 ); | |
| 590 | +	add_action('wp_enqueue_scripts', 'strip_manage_woocommerce_styles', 99); | |
| 591 | 591 | |
| 592 | 592 | /** | 
| 593 | 593 | * Remove some WooCommerce queries. | 
| 594 | 594 | */ | 
| 595 | 595 |  	function strip_manage_woocommerce_styles() { | 
| 596 | 596 | // remove generator meta tag. | 
| 597 | - remove_action( 'wp_head', array( 'woocommerce', 'generator' ) ); // this line when used with $GLOBALS['woocommerce'] prompts an error when Woo is deactivated though. | |
| 597 | +		remove_action('wp_head', array('woocommerce', 'generator')); // this line when used with $GLOBALS['woocommerce'] prompts an error when Woo is deactivated though. | |
| 598 | 598 | // first check that woo exists to prevent fatal errors. | 
| 599 | -		if ( function_exists( 'strip_is_woocommerce_activated' ) ) { | |
| 599 | +		if (function_exists('strip_is_woocommerce_activated')) { | |
| 600 | 600 | // dequeue scripts and styles, unless we're in the store. | 
| 601 | -			if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) { | |
| 602 | - wp_dequeue_style( 'woocommerce_frontend_styles' ); | |
| 603 | - wp_dequeue_style( 'woocommerce-general' ); | |
| 604 | - wp_dequeue_style( 'woocommerce-layout' ); | |
| 605 | - wp_dequeue_style( 'woocommerce-smallscreen' ); | |
| 606 | - wp_dequeue_style( 'woocommerce_fancybox_styles' ); | |
| 607 | - wp_dequeue_style( 'woocommerce_chosen_styles' ); | |
| 608 | - wp_dequeue_style( 'woocommerce_prettyPhoto_css' ); | |
| 609 | - wp_dequeue_style( 'select2' ); | |
| 610 | - wp_dequeue_style( 'strip-woocommerce' ); // the theme's CSS overwrite. | |
| 611 | - wp_dequeue_script( 'wc-add-payment-method' ); | |
| 612 | - wp_dequeue_script( 'wc-lost-password' ); | |
| 613 | - wp_dequeue_script( 'wc_price_slider' ); | |
| 614 | - wp_dequeue_script( 'wc-single-product' ); | |
| 615 | - wp_dequeue_script( 'wc-add-to-cart' ); | |
| 616 | - wp_dequeue_script( 'wc-cart-fragments' ); | |
| 617 | - wp_dequeue_script( 'wc-credit-card-form' ); | |
| 618 | - wp_dequeue_script( 'wc-checkout' ); | |
| 619 | - wp_dequeue_script( 'wc-add-to-cart-variation' ); | |
| 620 | - wp_dequeue_script( 'wc-single-product' ); | |
| 621 | - wp_dequeue_script( 'wc-cart' ); | |
| 622 | - wp_dequeue_script( 'wc-chosen' ); | |
| 623 | - wp_dequeue_script( 'woocommerce' ); | |
| 624 | - wp_dequeue_script( 'jquery-cookie' ); | |
| 625 | - wp_dequeue_script( 'prettyPhoto' ); | |
| 626 | - wp_dequeue_script( 'prettyPhoto-init' ); | |
| 627 | - wp_dequeue_script( 'jquery-blockui' ); | |
| 628 | - wp_dequeue_script( 'jquery-placeholder' ); | |
| 629 | - wp_dequeue_script( 'jquery-payment' ); | |
| 630 | - wp_dequeue_script( 'fancybox' ); | |
| 631 | - wp_dequeue_script( 'jqueryui' ); | |
| 601 | +			if ( ! is_woocommerce() && ! is_cart() && ! is_checkout()) { | |
| 602 | +				wp_dequeue_style('woocommerce_frontend_styles'); | |
| 603 | +				wp_dequeue_style('woocommerce-general'); | |
| 604 | +				wp_dequeue_style('woocommerce-layout'); | |
| 605 | +				wp_dequeue_style('woocommerce-smallscreen'); | |
| 606 | +				wp_dequeue_style('woocommerce_fancybox_styles'); | |
| 607 | +				wp_dequeue_style('woocommerce_chosen_styles'); | |
| 608 | +				wp_dequeue_style('woocommerce_prettyPhoto_css'); | |
| 609 | +				wp_dequeue_style('select2'); | |
| 610 | +				wp_dequeue_style('strip-woocommerce'); // the theme's CSS overwrite. | |
| 611 | +				wp_dequeue_script('wc-add-payment-method'); | |
| 612 | +				wp_dequeue_script('wc-lost-password'); | |
| 613 | +				wp_dequeue_script('wc_price_slider'); | |
| 614 | +				wp_dequeue_script('wc-single-product'); | |
| 615 | +				wp_dequeue_script('wc-add-to-cart'); | |
| 616 | +				wp_dequeue_script('wc-cart-fragments'); | |
| 617 | +				wp_dequeue_script('wc-credit-card-form'); | |
| 618 | +				wp_dequeue_script('wc-checkout'); | |
| 619 | +				wp_dequeue_script('wc-add-to-cart-variation'); | |
| 620 | +				wp_dequeue_script('wc-single-product'); | |
| 621 | +				wp_dequeue_script('wc-cart'); | |
| 622 | +				wp_dequeue_script('wc-chosen'); | |
| 623 | +				wp_dequeue_script('woocommerce'); | |
| 624 | +				wp_dequeue_script('jquery-cookie'); | |
| 625 | +				wp_dequeue_script('prettyPhoto'); | |
| 626 | +				wp_dequeue_script('prettyPhoto-init'); | |
| 627 | +				wp_dequeue_script('jquery-blockui'); | |
| 628 | +				wp_dequeue_script('jquery-placeholder'); | |
| 629 | +				wp_dequeue_script('jquery-payment'); | |
| 630 | +				wp_dequeue_script('fancybox'); | |
| 631 | +				wp_dequeue_script('jqueryui'); | |
| 632 | 632 | } | 
| 633 | 633 | } | 
| 634 | 634 | } | 
| 635 | 635 | |
| 636 | - add_action( 'pre_get_posts', 'strip_set_posts_per_page' ); | |
| 636 | +	add_action('pre_get_posts', 'strip_set_posts_per_page'); | |
| 637 | 637 | /** | 
| 638 | 638 | * Set posts, WooCommerce products & comics number per archive page | 
| 639 | 639 | * Fixes 404 error on pagination due to CTP conflicting with WordPress posts_per_page default | 
| @@ -642,28 +642,28 @@ discard block | ||
| 642 | 642 | * @param string $query strip_set_posts_per_page. | 
| 643 | 643 | * @return the posts per page. | 
| 644 | 644 | */ | 
| 645 | -	function strip_set_posts_per_page( $query ) { | |
| 645 | +	function strip_set_posts_per_page($query) { | |
| 646 | 646 | global $wp_the_query; | 
| 647 | -		if (  ( $query === $wp_the_query ) && ( is_home() ) && ( is_search() ) ) { | |
| 648 | - $wp_the_query->set( 'post_type', array( 'post', 'comic', 'posts_per_page', 12 ) ); | |
| 647 | +		if (($query === $wp_the_query) && (is_home()) && (is_search())) { | |
| 648 | +			$wp_the_query->set('post_type', array('post', 'comic', 'posts_per_page', 12)); | |
| 649 | 649 | } | 
| 650 | -		if ( ( $query === $wp_the_query ) && ( is_post_type_archive( 'product' ) ) ) { | |
| 651 | - $wp_the_query->set( 'posts_per_page', 4 ); | |
| 652 | -		} elseif ( ( $query === $wp_the_query ) && ( is_archive() ) && ( is_tax( 'story' ) ) ) { | |
| 653 | - $wp_the_query->set( 'posts_per_page', 3 ); | |
| 650 | +		if (($query === $wp_the_query) && (is_post_type_archive('product'))) { | |
| 651 | +			$wp_the_query->set('posts_per_page', 4); | |
| 652 | +		} elseif (($query === $wp_the_query) && (is_archive()) && (is_tax('story'))) { | |
| 653 | +			$wp_the_query->set('posts_per_page', 3); | |
| 654 | 654 | } | 
| 655 | 655 | return $wp_the_query; | 
| 656 | 656 | } | 
| 657 | 657 | |
| 658 | - add_action( 'pre_get_posts', 'add_my_post_types_to_query' ); | |
| 658 | +	add_action('pre_get_posts', 'add_my_post_types_to_query'); | |
| 659 | 659 | /** | 
| 660 | 660 | * Show 'comics' post types on home page. | 
| 661 | 661 | * | 
| 662 | 662 | * @param string $query add_my_post_types_to_query. | 
| 663 | 663 | */ | 
| 664 | -	function add_my_post_types_to_query( $query ) { | |
| 665 | -		if ( is_home() && $query->is_main_query() ) { | |
| 666 | - $query->set( 'post_type', array( 'post', 'page', 'comic' ) ); | |
| 664 | +	function add_my_post_types_to_query($query) { | |
| 665 | +		if (is_home() && $query->is_main_query()) { | |
| 666 | +			$query->set('post_type', array('post', 'page', 'comic')); | |
| 667 | 667 | |
| 668 | 668 | } | 
| 669 | 669 | return $query; | 
| @@ -676,35 +676,35 @@ discard block | ||
| 676 | 676 | * @param string $post_id set_default_object_terms. | 
| 677 | 677 | * @param string $post set_default_object_terms. | 
| 678 | 678 | */ | 
| 679 | -	function set_default_object_terms( $post_id, $post ) { | |
| 680 | -		if ( 'publish' === $post->post_status && 'comic' === $post->post_type ) { | |
| 679 | +	function set_default_object_terms($post_id, $post) { | |
| 680 | +		if ('publish' === $post->post_status && 'comic' === $post->post_type) { | |
| 681 | 681 | $defaults = array( | 
| 682 | - 'story' => array( 'draft' ), | |
| 682 | +			'story' => array('draft'), | |
| 683 | 683 | ); | 
| 684 | - $taxonomies = get_object_taxonomies( $post->post_type ); | |
| 685 | -			foreach ( (array) $taxonomies as $taxonomy ) { | |
| 686 | - $terms = get_the_terms( $post_id, $taxonomy ); | |
| 687 | -				if ( empty( $terms ) && array_key_exists( $taxonomy, $defaults ) ) { | |
| 688 | - wp_set_object_terms( $post_id, $defaults[ $taxonomy ], $taxonomy ); | |
| 684 | + $taxonomies = get_object_taxonomies($post->post_type); | |
| 685 | +			foreach ((array) $taxonomies as $taxonomy) { | |
| 686 | + $terms = get_the_terms($post_id, $taxonomy); | |
| 687 | +				if (empty($terms) && array_key_exists($taxonomy, $defaults)) { | |
| 688 | + wp_set_object_terms($post_id, $defaults[$taxonomy], $taxonomy); | |
| 689 | 689 | } | 
| 690 | 690 | } | 
| 691 | 691 | } | 
| 692 | 692 | } | 
| 693 | - add_action( 'save_post', 'set_default_object_terms', 0, 2 ); | |
| 693 | +	add_action('save_post', 'set_default_object_terms', 0, 2); | |
| 694 | 694 | |
| 695 | 695 | /** | 
| 696 | 696 | * Remove jquery migrate $scripts for enhanced performance. | 
| 697 | 697 | * | 
| 698 | 698 | * @param strings $scripts remove_jquery_migrate. | 
| 699 | 699 | */ | 
| 700 | -	function remove_jquery_migrate( $scripts ) { | |
| 701 | -		if ( is_admin() ) { | |
| 700 | +	function remove_jquery_migrate($scripts) { | |
| 701 | +		if (is_admin()) { | |
| 702 | 702 | return; | 
| 703 | 703 | } | 
| 704 | - $scripts->remove( 'jquery' ); | |
| 705 | - $scripts->add( 'jquery', false, array( 'jquery-core' ), '1.10.2' ); | |
| 704 | +		 $scripts->remove('jquery'); | |
| 705 | +		 $scripts->add('jquery', false, array('jquery-core'), '1.10.2'); | |
| 706 | 706 | } | 
| 707 | - add_action( 'wp_default_scripts', 'remove_jquery_migrate' ); | |
| 707 | +		add_action('wp_default_scripts', 'remove_jquery_migrate'); | |
| 708 | 708 | |
| 709 | 709 | /** | 
| 710 | 710 | * Remove login errors notices (security) | 
| @@ -712,4 +712,4 @@ discard block | ||
| 712 | 712 |  	function no_wordpress_errors() { | 
| 713 | 713 | return 'Something is wrong!'; | 
| 714 | 714 | } | 
| 715 | - add_filter( 'login_errors', 'no_wordpress_errors' ); | |
| 715 | +		add_filter('login_errors', 'no_wordpress_errors'); | |