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