-
+
-
+
diff --git a/global-templates/left-sidebar-check.php b/global-templates/left-sidebar-check.php
index cd36173..3ac77bf 100644
--- a/global-templates/left-sidebar-check.php
+++ b/global-templates/left-sidebar-check.php
@@ -8,14 +8,12 @@
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
-?>
-
-
+
diff --git a/global-templates/right-sidebar-check.php b/global-templates/right-sidebar-check.php
index e32e375..826baab 100644
--- a/global-templates/right-sidebar-check.php
+++ b/global-templates/right-sidebar-check.php
@@ -16,6 +16,6 @@ if ( ! defined( 'ABSPATH' ) ) {
-
+
diff --git a/inc/custom-header.php b/inc/custom-header.php
index b66a416..b711882 100644
--- a/inc/custom-header.php
+++ b/inc/custom-header.php
@@ -11,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) {
add_action( 'after_setup_theme', 'understrap_custom_header_setup' );
-if ( ! function_exists ( 'understrap_custom_header_setup' ) ) {
+if ( ! function_exists( 'understrap_custom_header_setup' ) ) {
function understrap_custom_header_setup() {
/**
@@ -22,28 +22,36 @@ if ( ! function_exists ( 'understrap_custom_header_setup' ) ) {
* @param array $args {
* An array of custom-header support arguments.
*
- * @type string $default-image Default image of the header.
+ * @type string $default-image Default image of the header.
* @type string $default_text_color Default color of the header text.
* @type int $width Width in pixels of the custom header image. Default 954.
* @type int $height Height in pixels of the custom header image. Default 1300.
* @type string $wp-head-callback Callback function used to styles the header image and text
* displayed on the blog.
- * @type string $flex-height Flex support for height of header.
+ * @type string $flex-height Flex support for height of header.
* }
*/
- add_theme_support( 'custom-header', apply_filters( 'understrap_custom_header_args', array(
- 'default-image' => get_parent_theme_file_uri( '/img/header.jpg' ),
- 'width' => 2000,
- 'height' => 1200,
- 'flex-height' => true,
- ) ) );
+ add_theme_support(
+ 'custom-header',
+ apply_filters(
+ 'understrap_custom_header_args',
+ array(
+ 'default-image' => get_parent_theme_file_uri( '/img/header.jpg' ),
+ 'width' => 2000,
+ 'height' => 1200,
+ 'flex-height' => true,
+ )
+ )
+ );
- register_default_headers( array(
- 'default-image' => array(
- 'url' => '%s/img/header.jpg',
- 'thumbnail_url' => '%s/img/header.jpg',
- 'description' => __( 'Default Header Image', 'understrap' ),
- ),
- ) );
+ register_default_headers(
+ array(
+ 'default-image' => array(
+ 'url' => '%s/img/header.jpg',
+ 'thumbnail_url' => '%s/img/header.jpg',
+ 'description' => __( 'Default Header Image', 'understrap' ),
+ ),
+ )
+ );
}
-}
\ No newline at end of file
+}
diff --git a/inc/customizer.php b/inc/customizer.php
index 6729d77..c774f43 100644
--- a/inc/customizer.php
+++ b/inc/customizer.php
@@ -37,12 +37,15 @@ if ( ! function_exists( 'understrap_theme_customize_register' ) ) {
function understrap_theme_customize_register( $wp_customize ) {
// Theme layout settings.
- $wp_customize->add_section( 'understrap_theme_layout_options', array(
- 'title' => __( 'Theme Layout Settings', 'understrap' ),
- 'capability' => 'edit_theme_options',
- 'description' => __( 'Container width and sidebar defaults', 'understrap' ),
- 'priority' => 160,
- ) );
+ $wp_customize->add_section(
+ 'understrap_theme_layout_options',
+ array(
+ 'title' => __( 'Theme Layout Settings', 'understrap' ),
+ 'capability' => 'edit_theme_options',
+ 'description' => __( 'Container width and sidebar defaults', 'understrap' ),
+ 'priority' => 160,
+ )
+ );
/**
* Select sanitization function
@@ -51,30 +54,34 @@ if ( ! function_exists( 'understrap_theme_customize_register' ) ) {
* @param WP_Customize_Setting $setting Setting instance.
* @return string Sanitized slug if it is a valid choice; otherwise, the setting default.
*/
- function understrap_theme_slug_sanitize_select( $input, $setting ){
+ function understrap_theme_slug_sanitize_select( $input, $setting ) {
- // Ensure input is a slug (lowercase alphanumeric characters, dashes and underscores are allowed only).
- $input = sanitize_key( $input );
+ // Ensure input is a slug (lowercase alphanumeric characters, dashes and underscores are allowed only).
+ $input = sanitize_key( $input );
- // Get the list of possible select options.
- $choices = $setting->manager->get_control( $setting->id )->choices;
+ // Get the list of possible select options.
+ $choices = $setting->manager->get_control( $setting->id )->choices;
- // If the input is a valid key, return it; otherwise, return the default.
- return ( array_key_exists( $input, $choices ) ? $input : $setting->default );
+ // If the input is a valid key, return it; otherwise, return the default.
+ return ( array_key_exists( $input, $choices ) ? $input : $setting->default );
- }
+ }
- $wp_customize->add_setting( 'understrap_container_type', array(
- 'default' => 'container',
- 'type' => 'theme_mod',
- 'sanitize_callback' => 'understrap_theme_slug_sanitize_select',
- 'capability' => 'edit_theme_options',
- ) );
+ $wp_customize->add_setting(
+ 'understrap_container_type',
+ array(
+ 'default' => 'container',
+ 'type' => 'theme_mod',
+ 'sanitize_callback' => 'understrap_theme_slug_sanitize_select',
+ 'capability' => 'edit_theme_options',
+ )
+ );
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
- 'understrap_container_type', array(
+ 'understrap_container_type',
+ array(
'label' => __( 'Container Width', 'understrap' ),
'description' => __( 'Choose between Bootstrap\'s container and container-fluid', 'understrap' ),
'section' => 'understrap_theme_layout_options',
@@ -86,35 +93,43 @@ if ( ! function_exists( 'understrap_theme_customize_register' ) ) {
),
'priority' => '10',
)
- ) );
+ )
+ );
- $wp_customize->add_setting( 'understrap_sidebar_position', array(
- 'default' => 'right',
- 'type' => 'theme_mod',
- 'sanitize_callback' => 'sanitize_text_field',
- 'capability' => 'edit_theme_options',
- ) );
+ $wp_customize->add_setting(
+ 'understrap_sidebar_position',
+ array(
+ 'default' => 'right',
+ 'type' => 'theme_mod',
+ 'sanitize_callback' => 'sanitize_text_field',
+ 'capability' => 'edit_theme_options',
+ )
+ );
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
- 'understrap_sidebar_position', array(
- 'label' => __( 'Sidebar Positioning', 'understrap' ),
- 'description' => __( 'Set sidebar\'s default position. Can either be: right, left, both or none. Note: this can be overridden on individual pages.',
- 'understrap' ),
- 'section' => 'understrap_theme_layout_options',
- 'settings' => 'understrap_sidebar_position',
- 'type' => 'select',
+ 'understrap_sidebar_position',
+ array(
+ 'label' => __( 'Sidebar Positioning', 'understrap' ),
+ 'description' => __(
+ 'Set sidebar\'s default position. Can either be: right, left, both or none. Note: this can be overridden on individual pages.',
+ 'understrap'
+ ),
+ 'section' => 'understrap_theme_layout_options',
+ 'settings' => 'understrap_sidebar_position',
+ 'type' => 'select',
'sanitize_callback' => 'understrap_theme_slug_sanitize_select',
- 'choices' => array(
+ 'choices' => array(
'right' => __( 'Right sidebar', 'understrap' ),
'left' => __( 'Left sidebar', 'understrap' ),
'both' => __( 'Left & Right sidebars', 'understrap' ),
'none' => __( 'No sidebar', 'understrap' ),
),
- 'priority' => '20',
+ 'priority' => '20',
)
- ) );
+ )
+ );
}
} // endif function_exists( 'understrap_theme_customize_register' ).
add_action( 'customize_register', 'understrap_theme_customize_register' );
@@ -127,8 +142,12 @@ if ( ! function_exists( 'understrap_customize_preview_js' ) ) {
* Setup JS integration for live previewing.
*/
function understrap_customize_preview_js() {
- wp_enqueue_script( 'understrap_customizer', get_template_directory_uri() . '/js/customizer.js',
- array( 'customize-preview' ), '20130508', true
+ wp_enqueue_script(
+ 'understrap_customizer',
+ get_template_directory_uri() . '/js/customizer.js',
+ array( 'customize-preview' ),
+ '20130508',
+ true
);
}
}
diff --git a/inc/editor.php b/inc/editor.php
index 4b71ee9..826e21a 100644
--- a/inc/editor.php
+++ b/inc/editor.php
@@ -15,64 +15,64 @@ if ( ! defined( 'ABSPATH' ) ) {
add_action( 'admin_init', 'understrap_wpdocs_theme_add_editor_styles' );
-if ( ! function_exists ( 'understrap_wpdocs_theme_add_editor_styles' ) ) {
- function understrap_wpdocs_theme_add_editor_styles() {
- add_editor_style( 'css/custom-editor-style.min.css' );
- }
+if ( ! function_exists( 'understrap_wpdocs_theme_add_editor_styles' ) ) {
+ function understrap_wpdocs_theme_add_editor_styles() {
+ add_editor_style( 'css/custom-editor-style.min.css' );
+ }
}
// Add TinyMCE style formats.
add_filter( 'mce_buttons_2', 'understrap_tiny_mce_style_formats' );
-if ( ! function_exists ( 'understrap_tiny_mce_style_formats' ) ) {
- function understrap_tiny_mce_style_formats( $styles ) {
+if ( ! function_exists( 'understrap_tiny_mce_style_formats' ) ) {
+ function understrap_tiny_mce_style_formats( $styles ) {
- array_unshift( $styles, 'styleselect' );
- return $styles;
- }
+ array_unshift( $styles, 'styleselect' );
+ return $styles;
+ }
}
add_filter( 'tiny_mce_before_init', 'understrap_tiny_mce_before_init' );
-if ( ! function_exists ( 'understrap_tiny_mce_before_init' ) ) {
- function understrap_tiny_mce_before_init( $settings ) {
+if ( ! function_exists( 'understrap_tiny_mce_before_init' ) ) {
+ function understrap_tiny_mce_before_init( $settings ) {
- $style_formats = array(
- array(
- 'title' => 'Lead Paragraph',
- 'selector' => 'p',
- 'classes' => 'lead',
- 'wrapper' => true
- ),
- array(
- 'title' => 'Small',
- 'inline' => 'small'
- ),
- array(
- 'title' => 'Blockquote',
- 'block' => 'blockquote',
- 'classes' => 'blockquote',
- 'wrapper' => true
- ),
- array(
- 'title' => 'Blockquote Footer',
- 'block' => 'footer',
- 'classes' => 'blockquote-footer',
- 'wrapper' => true
- ),
- array(
- 'title' => 'Cite',
- 'inline' => 'cite'
- )
- );
-
- if ( isset( $settings['style_formats'] ) ) {
- $orig_style_formats = json_decode($settings['style_formats'],true);
- $style_formats = array_merge($orig_style_formats,$style_formats);
- }
+ $style_formats = array(
+ array(
+ 'title' => 'Lead Paragraph',
+ 'selector' => 'p',
+ 'classes' => 'lead',
+ 'wrapper' => true,
+ ),
+ array(
+ 'title' => 'Small',
+ 'inline' => 'small',
+ ),
+ array(
+ 'title' => 'Blockquote',
+ 'block' => 'blockquote',
+ 'classes' => 'blockquote',
+ 'wrapper' => true,
+ ),
+ array(
+ 'title' => 'Blockquote Footer',
+ 'block' => 'footer',
+ 'classes' => 'blockquote-footer',
+ 'wrapper' => true,
+ ),
+ array(
+ 'title' => 'Cite',
+ 'inline' => 'cite',
+ ),
+ );
- $settings['style_formats'] = json_encode( $style_formats );
- return $settings;
- }
+ if ( isset( $settings['style_formats'] ) ) {
+ $orig_style_formats = json_decode( $settings['style_formats'], true );
+ $style_formats = array_merge( $orig_style_formats, $style_formats );
+ }
+
+ $settings['style_formats'] = json_encode( $style_formats );
+ return $settings;
+ }
}
diff --git a/inc/enqueue.php b/inc/enqueue.php
index 9748b81..92c6798 100644
--- a/inc/enqueue.php
+++ b/inc/enqueue.php
@@ -15,15 +15,15 @@ if ( ! function_exists( 'understrap_scripts' ) ) {
*/
function understrap_scripts() {
// Get the theme data.
- $the_theme = wp_get_theme();
+ $the_theme = wp_get_theme();
$theme_version = $the_theme->get( 'Version' );
-
- $css_version = $theme_version . '.' . filemtime(get_template_directory() . '/css/theme.min.css');
+
+ $css_version = $theme_version . '.' . filemtime( get_template_directory() . '/css/theme.min.css' );
wp_enqueue_style( 'understrap-styles', get_stylesheet_directory_uri() . '/css/theme.min.css', array(), $css_version );
- wp_enqueue_script( 'jquery');
-
- $js_version = $theme_version . '.' . filemtime(get_template_directory() . '/js/theme.min.js');
+ wp_enqueue_script( 'jquery' );
+
+ $js_version = $theme_version . '.' . filemtime( get_template_directory() . '/js/theme.min.js' );
wp_enqueue_script( 'understrap-scripts', get_template_directory_uri() . '/js/theme.min.js', array(), $js_version, true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
@@ -31,4 +31,4 @@ if ( ! function_exists( 'understrap_scripts' ) ) {
}
} // endif function_exists( 'understrap_scripts' ).
-add_action( 'wp_enqueue_scripts', 'understrap_scripts' );
\ No newline at end of file
+add_action( 'wp_enqueue_scripts', 'understrap_scripts' );
diff --git a/inc/hooks.php b/inc/hooks.php
index 2de6401..e6752a5 100644
--- a/inc/hooks.php
+++ b/inc/hooks.php
@@ -10,40 +10,44 @@ if ( ! defined( 'ABSPATH' ) ) {
}
if ( ! function_exists( 'understrap_site_info' ) ) {
- /**
- * Add site info hook to WP hook library.
- */
- function understrap_site_info() {
- do_action( 'understrap_site_info' );
- }
+ /**
+ * Add site info hook to WP hook library.
+ */
+ function understrap_site_info() {
+ do_action( 'understrap_site_info' );
+ }
}
if ( ! function_exists( 'understrap_add_site_info' ) ) {
- add_action( 'understrap_site_info', 'understrap_add_site_info' );
+ add_action( 'understrap_site_info', 'understrap_add_site_info' );
- /**
- * Add site info content.
- */
- function understrap_add_site_info() {
- $the_theme = wp_get_theme();
-
- $site_info = sprintf(
- '
%2$s | %3$s(%4$s)',
- esc_url( __( 'http://wordpress.org/', 'understrap' ) ),
- sprintf(
- /* translators:*/
- esc_html__( 'Proudly powered by %s', 'understrap' ), 'WordPress'
- ),
- sprintf( // WPCS: XSS ok.
- /* translators:*/
- esc_html__( 'Theme: %1$s by %2$s.', 'understrap' ), $the_theme->get( 'Name' ), '
understrap.com'
- ),
- sprintf( // WPCS: XSS ok.
- /* translators:*/
- esc_html__( 'Version: %1$s', 'understrap' ), $the_theme->get( 'Version' )
- )
- );
+ /**
+ * Add site info content.
+ */
+ function understrap_add_site_info() {
+ $the_theme = wp_get_theme();
- echo apply_filters( 'understrap_site_info_content', $site_info ); // WPCS: XSS ok.
- }
+ $site_info = sprintf(
+ '
%2$s | %3$s(%4$s)',
+ esc_url( __( 'http://wordpress.org/', 'understrap' ) ),
+ sprintf(
+ /* translators:*/
+ esc_html__( 'Proudly powered by %s', 'understrap' ),
+ 'WordPress'
+ ),
+ sprintf( // WPCS: XSS ok.
+ /* translators:*/
+ esc_html__( 'Theme: %1$s by %2$s.', 'understrap' ),
+ $the_theme->get( 'Name' ),
+ '
understrap.com'
+ ),
+ sprintf( // WPCS: XSS ok.
+ /* translators:*/
+ esc_html__( 'Version: %1$s', 'understrap' ),
+ $the_theme->get( 'Version' )
+ )
+ );
+
+ echo apply_filters( 'understrap_site_info_content', $site_info ); // WPCS: XSS ok.
+ }
}
diff --git a/inc/jetpack.php b/inc/jetpack.php
index 1c2579c..73c8e04 100644
--- a/inc/jetpack.php
+++ b/inc/jetpack.php
@@ -20,14 +20,17 @@ if ( ! defined( 'ABSPATH' ) ) {
add_action( 'after_setup_theme', 'understrap_components_jetpack_setup' );
-if ( ! function_exists ( 'understrap_components_jetpack_setup' ) ) {
+if ( ! function_exists( 'understrap_components_jetpack_setup' ) ) {
function understrap_components_jetpack_setup() {
// Add theme support for Infinite Scroll.
- add_theme_support( 'infinite-scroll', array(
- 'container' => 'main',
- 'render' => 'understrap_components_infinite_scroll_render',
- 'footer' => 'page',
- ) );
+ add_theme_support(
+ 'infinite-scroll',
+ array(
+ 'container' => 'main',
+ 'render' => 'understrap_components_infinite_scroll_render',
+ 'footer' => 'page',
+ )
+ );
// Add theme support for Responsive Videos.
add_theme_support( 'jetpack-responsive-videos' );
@@ -43,7 +46,7 @@ if ( ! function_exists ( 'understrap_components_jetpack_setup' ) ) {
* Custom render function for Infinite Scroll.
*/
-if ( ! function_exists ( 'understrap_components_infinite_scroll_render' ) ) {
+if ( ! function_exists( 'understrap_components_infinite_scroll_render' ) ) {
function understrap_components_infinite_scroll_render() {
while ( have_posts() ) {
the_post();
@@ -56,7 +59,7 @@ if ( ! function_exists ( 'understrap_components_infinite_scroll_render' ) ) {
}
}
-if ( ! function_exists ( 'understrap_components_social_menu' ) ) {
+if ( ! function_exists( 'understrap_components_social_menu' ) ) {
function understrap_components_social_menu() {
if ( ! function_exists( 'jetpack_social_menu' ) ) {
return;
@@ -64,4 +67,4 @@ if ( ! function_exists ( 'understrap_components_social_menu' ) ) {
jetpack_social_menu();
}
}
-}
\ No newline at end of file
+}
diff --git a/inc/pagination.php b/inc/pagination.php
index 9a6ff79..2e9dfa5 100644
--- a/inc/pagination.php
+++ b/inc/pagination.php
@@ -9,48 +9,51 @@ if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
-if ( ! function_exists ( 'understrap_pagination' ) ) {
+if ( ! function_exists( 'understrap_pagination' ) ) {
function understrap_pagination( $args = array(), $class = 'pagination' ) {
- if ($GLOBALS['wp_query']->max_num_pages <= 1) return;
+ if ( $GLOBALS['wp_query']->max_num_pages <= 1 ) {
+ return;
+ }
- $args = wp_parse_args( $args, array(
- 'mid_size' => 2,
- 'prev_next' => true,
- 'prev_text' => __('«', 'understrap'),
- 'next_text' => __('»', 'understrap'),
- 'screen_reader_text' => __('Posts navigation', 'understrap'),
- 'type' => 'array',
- 'current' => max( 1, get_query_var('paged') ),
- ) );
+ $args = wp_parse_args(
+ $args,
+ array(
+ 'mid_size' => 2,
+ 'prev_next' => true,
+ 'prev_text' => __( '«', 'understrap' ),
+ 'next_text' => __( '»', 'understrap' ),
+ 'screen_reader_text' => __( 'Posts navigation', 'understrap' ),
+ 'type' => 'array',
+ 'current' => max( 1, get_query_var( 'paged' ) ),
+ )
+ );
- $links = paginate_links($args);
+ $links = paginate_links( $args );
- ?>
+ ?>
-
-
-
diff --git a/inc/theme-settings.php b/inc/theme-settings.php
index 9bee616..0d2447d 100755
--- a/inc/theme-settings.php
+++ b/inc/theme-settings.php
@@ -3,14 +3,13 @@
* Check and setup theme's default settings
*
* @package understrap
- *
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
-if ( ! function_exists ( 'understrap_setup_theme_default_settings' ) ) {
+if ( ! function_exists( 'understrap_setup_theme_default_settings' ) ) {
function understrap_setup_theme_default_settings() {
// check if settings are set, if not set defaults.
@@ -33,4 +32,4 @@ if ( ! function_exists ( 'understrap_setup_theme_default_settings' ) ) {
set_theme_mod( 'understrap_container_type', 'container' );
}
}
-}
\ No newline at end of file
+}
diff --git a/inc/woocommerce.php b/inc/woocommerce.php
index 3cd8e9b..29d3de0 100644
--- a/inc/woocommerce.php
+++ b/inc/woocommerce.php
@@ -17,7 +17,7 @@ if ( ! function_exists( 'understrap_woocommerce_support' ) ) {
function understrap_woocommerce_support() {
add_theme_support( 'woocommerce' );
- // Add New Woocommerce 3.0.0 Product Gallery support
+ // Add New Woocommerce 3.0.0 Product Gallery support.
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-slider' );
@@ -30,31 +30,31 @@ if ( ! function_exists( 'understrap_woocommerce_support' ) ) {
/**
* First unhook the WooCommerce wrappers
*/
-remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
-remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
+remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 );
+remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 );
/**
* Then hook in your own functions to display the wrappers your theme requires
*/
-add_action('woocommerce_before_main_content', 'understrap_woocommerce_wrapper_start', 10);
-add_action('woocommerce_after_main_content', 'understrap_woocommerce_wrapper_end', 10);
+add_action( 'woocommerce_before_main_content', 'understrap_woocommerce_wrapper_start', 10 );
+add_action( 'woocommerce_after_main_content', 'understrap_woocommerce_wrapper_end', 10 );
if ( ! function_exists( 'understrap_woocommerce_wrapper_start' ) ) {
function understrap_woocommerce_wrapper_start() {
- $container = get_theme_mod( 'understrap_container_type' );
+ $container = get_theme_mod( 'understrap_container_type' );
echo '
';
- echo '
';
+ echo '
';
echo '
';
get_template_part( 'global-templates/left-sidebar-check' );
echo '';
}
}
if ( ! function_exists( 'understrap_woocommerce_wrapper_end' ) ) {
-function understrap_woocommerce_wrapper_end() {
- echo '';
- get_template_part( 'global-templates/right-sidebar-check' );
- echo '
';
- echo '
';
- echo '
';
+ function understrap_woocommerce_wrapper_end() {
+ echo '';
+ get_template_part( 'global-templates/right-sidebar-check' );
+ echo '
';
+ echo '