Merge pull request #856 from IanDelMar/wpcs

Fix formatting issues - wow...thx @IanDelMar !
This commit is contained in:
Holger 2018-12-18 14:23:10 +01:00 committed by GitHub
commit b9fc5ef0e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
34 changed files with 471 additions and 407 deletions

16
404.php
View File

@ -28,15 +28,13 @@ $container = get_theme_mod( 'understrap_container_type' );
<header class="page-header">
<h1 class="page-title"><?php esc_html_e( 'Oops! That page can&rsquo;t be found.',
'understrap' ); ?></h1>
<h1 class="page-title"><?php esc_html_e( 'Oops! That page can&rsquo;t be found.', 'understrap' ); ?></h1>
</header><!-- .page-header -->
<div class="page-content">
<p><?php esc_html_e( 'It looks like nothing was found at this location. Maybe try one of the links below or a search?',
'understrap' ); ?></p>
<p><?php esc_html_e( 'It looks like nothing was found at this location. Maybe try one of the links below or a search?', 'understrap' ); ?></p>
<?php get_search_form(); ?>
@ -50,13 +48,15 @@ $container = get_theme_mod( 'understrap_container_type' );
<ul>
<?php
wp_list_categories( array(
wp_list_categories(
array(
'orderby' => 'count',
'order' => 'DESC',
'show_count' => 1,
'title_li' => '',
'number' => 10,
) );
)
);
?>
</ul>
@ -83,8 +83,8 @@ $container = get_theme_mod( 'understrap_container_type' );
</div><!-- .row -->
</div><!-- Container end -->
</div><!-- #content -->
</div><!-- Wrapper end -->
</div><!-- #error-404-wrapper -->
<?php get_footer(); ?>

View File

@ -12,9 +12,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
get_header();
?>
<?php
$container = get_theme_mod( 'understrap_container_type' );
?>
@ -69,8 +67,8 @@ $container = get_theme_mod( 'understrap_container_type' );
</div> <!-- .row -->
</div><!-- Container end -->
</div><!-- #content -->
</div><!-- Wrapper end -->
</div><!-- #archive-wrapper -->
<?php get_footer(); ?>

View File

@ -15,7 +15,6 @@ get_header();
$container = get_theme_mod( 'understrap_container_type' );
?>
<div class="wrapper" id="author-wrapper">
<div class="<?php echo esc_attr( $container ); ?>" id="content" tabindex="-1">
@ -30,16 +29,20 @@ $container = get_theme_mod( 'understrap_container_type' );
<header class="page-header author-header">
<?php
$curauth = ( isset( $_GET['author_name'] ) ) ? get_user_by( 'slug',
$author_name ) : get_userdata( intval( $author ) );
if ( isset( $_GET['author_name'] ) ) {
$curauth = get_user_by( 'slug', $author_name );
} else {
$curauth = get_userdata( intval( $author ) );
}
?>
<h1><?php esc_html_e( 'About:', 'understrap' ); ?><?php echo esc_html( $curauth->nickname ); ?></h1>
<h1><?php echo esc_html__( 'About:', 'understrap' ) . ' ' . esc_html( $curauth->nickname ); ?></h1>
<?php if ( ! empty( $curauth->ID ) ) : ?>
<?php echo get_avatar( $curauth->ID ); ?>
<?php endif; ?>
<?php if ( ! empty( $curauth->user_url ) || ! empty( $curauth->user_description ) ) : ?>
<dl>
<?php if ( ! empty( $curauth->user_url ) ) : ?>
<dt><?php esc_html_e( 'Website', 'understrap' ); ?></dt>
@ -50,12 +53,12 @@ $container = get_theme_mod( 'understrap_container_type' );
<?php if ( ! empty( $curauth->user_description ) ) : ?>
<dt><?php esc_html_e( 'Profile', 'understrap' ); ?></dt>
<dd><?php echo esc_html( $curauth->user_description ); ?></dd>
<dd><?php esc_html_e( $curauth->user_description ); ?></dd>
<?php endif; ?>
</dl>
<?php endif; ?>
<h2><?php esc_html_e( 'Posts by', 'understrap' ); ?> <?php echo esc_html( $curauth->nickname ); ?>
:</h2>
<h2><?php echo esc_html( 'Posts by', 'understrap' ) . ' ' . esc_html( $curauth->nickname ); ?>:</h2>
</header><!-- .page-header -->
@ -65,11 +68,17 @@ $container = get_theme_mod( 'understrap_container_type' );
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<li>
<a rel="bookmark" href="<?php the_permalink() ?>"
title="<?php esc_html_e( 'Permanent Link:', 'understrap' ); ?> <?php the_title(); ?>">
<?php the_title(); ?></a>,
<?php understrap_posted_on(); ?> <?php esc_html_e( 'in',
'understrap' ); ?> <?php the_category( '&' ); ?>
<?php
printf(
'<a rel="bookmark" href="%1$s" title="%2$s %3$s">%3$s</a>',
esc_url( apply_filters( 'the_permalink', get_permalink( $post ), $post ) ),
esc_attr( __( 'Permanent Link:', 'understrap' ) ),
the_title( '', '', false )
);
?>
<?php understrap_posted_on(); ?>
<?php esc_html_e( 'in', 'understrap' ); ?>
<?php the_category( '&' ); ?>
</li>
<?php endwhile; ?>
@ -93,8 +102,8 @@ $container = get_theme_mod( 'understrap_container_type' );
</div> <!-- .row -->
</div><!-- Container end -->
</div><!-- #content -->
</div><!-- Wrapper end -->
</div><!-- #author-wrapper -->
<?php get_footer(); ?>

View File

@ -32,7 +32,7 @@ if ( post_password_required() ) {
<?php
$comments_number = get_comments_number();
if ( 1 === (int)$comments_number ) {
if ( 1 === (int) $comments_number ) {
printf(
/* translators: %s: post title */
esc_html_x( 'One thought on &ldquo;%s&rdquo;', 'comments title', 'understrap' ),
@ -63,12 +63,15 @@ if ( post_password_required() ) {
<h1 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'understrap' ); ?></h1>
<?php if ( get_previous_comments_link() ) { ?>
<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments',
'understrap' ) ); ?></div>
<?php }
if ( get_next_comments_link() ) { ?>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;',
'understrap' ) ); ?></div>
<div class="nav-previous">
<?php previous_comments_link( __( '&larr; Older Comments', 'understrap' ) ); ?>
</div>
<?php } ?>
<?php if ( get_next_comments_link() ) { ?>
<div class="nav-next">
<?php next_comments_link( __( 'Newer Comments &rarr;', 'understrap' ) ); ?>
</div>
<?php } ?>
</nav><!-- #comment-nav-above -->
@ -78,10 +81,12 @@ if ( post_password_required() ) {
<ol class="comment-list">
<?php
wp_list_comments( array(
wp_list_comments(
array(
'style' => 'ol',
'short_ping' => true,
) );
)
);
?>
</ol><!-- .comment-list -->
@ -93,12 +98,15 @@ if ( post_password_required() ) {
<h1 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'understrap' ); ?></h1>
<?php if ( get_previous_comments_link() ) { ?>
<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments',
'understrap' ) ); ?></div>
<?php }
if ( get_next_comments_link() ) { ?>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;',
'understrap' ) ); ?></div>
<div class="nav-previous">
<?php previous_comments_link( __( '&larr; Older Comments', 'understrap' ) ); ?>
</div>
<?php } ?>
<?php if ( get_next_comments_link() ) { ?>
<div class="nav-next">
<?php next_comments_link( __( 'Newer Comments &rarr;', 'understrap' ) ); ?>
</div>
<?php } ?>
</nav><!-- #comment-nav-below -->

View File

@ -8,9 +8,7 @@
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
<?php
$sidebar_pos = get_theme_mod( 'understrap_sidebar_position' );
?>

View File

@ -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() {
/**
@ -31,19 +31,27 @@ if ( ! function_exists ( 'understrap_custom_header_setup' ) ) {
* @type string $flex-height Flex support for height of header.
* }
*/
add_theme_support( 'custom-header', apply_filters( 'understrap_custom_header_args', array(
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(
register_default_headers(
array(
'default-image' => array(
'url' => '%s/img/header.jpg',
'thumbnail_url' => '%s/img/header.jpg',
'description' => __( 'Default Header Image', 'understrap' ),
),
) );
)
);
}
}

View File

@ -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(
$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,7 +54,7 @@ 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 );
@ -64,17 +67,21 @@ if ( ! function_exists( 'understrap_theme_customize_register' ) ) {
}
$wp_customize->add_setting( 'understrap_container_type', array(
$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,22 +93,29 @@ if ( ! function_exists( 'understrap_theme_customize_register' ) ) {
),
'priority' => '10',
)
) );
)
);
$wp_customize->add_setting( 'understrap_sidebar_position', array(
$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(
'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' ),
'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',
@ -114,7 +128,8 @@ if ( ! function_exists( 'understrap_theme_customize_register' ) ) {
),
'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
);
}
}

View File

@ -15,7 +15,7 @@ if ( ! defined( 'ABSPATH' ) ) {
add_action( 'admin_init', 'understrap_wpdocs_theme_add_editor_styles' );
if ( ! function_exists ( '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' );
}
@ -24,7 +24,7 @@ if ( ! function_exists ( 'understrap_wpdocs_theme_add_editor_styles' ) ) {
// Add TinyMCE style formats.
add_filter( 'mce_buttons_2', 'understrap_tiny_mce_style_formats' );
if ( ! function_exists ( 'understrap_tiny_mce_style_formats' ) ) {
if ( ! function_exists( 'understrap_tiny_mce_style_formats' ) ) {
function understrap_tiny_mce_style_formats( $styles ) {
array_unshift( $styles, 'styleselect' );
@ -35,7 +35,7 @@ if ( ! function_exists ( 'understrap_tiny_mce_style_formats' ) ) {
add_filter( 'tiny_mce_before_init', 'understrap_tiny_mce_before_init' );
if ( ! function_exists ( 'understrap_tiny_mce_before_init' ) ) {
if ( ! function_exists( 'understrap_tiny_mce_before_init' ) ) {
function understrap_tiny_mce_before_init( $settings ) {
$style_formats = array(
@ -43,33 +43,33 @@ if ( ! function_exists ( 'understrap_tiny_mce_before_init' ) ) {
'title' => 'Lead Paragraph',
'selector' => 'p',
'classes' => 'lead',
'wrapper' => true
'wrapper' => true,
),
array(
'title' => 'Small',
'inline' => 'small'
'inline' => 'small',
),
array(
'title' => 'Blockquote',
'block' => 'blockquote',
'classes' => 'blockquote',
'wrapper' => true
'wrapper' => true,
),
array(
'title' => 'Blockquote Footer',
'block' => 'footer',
'classes' => 'blockquote-footer',
'wrapper' => true
'wrapper' => true,
),
array(
'title' => 'Cite',
'inline' => '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);
$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 );

View File

@ -18,12 +18,12 @@ if ( ! function_exists( 'understrap_scripts' ) ) {
$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');
wp_enqueue_script( 'jquery' );
$js_version = $theme_version . '.' . filemtime(get_template_directory() . '/js/theme.min.js');
$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' );

View File

@ -32,15 +32,19 @@ if ( ! function_exists( 'understrap_add_site_info' ) ) {
esc_url( __( 'http://wordpress.org/', 'understrap' ) ),
sprintf(
/* translators:*/
esc_html__( 'Proudly powered by %s', 'understrap' ), 'WordPress'
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' ), '<a href="' . esc_url( __( 'http://understrap.com', 'understrap' ) ) . '">understrap.com</a>'
esc_html__( 'Theme: %1$s by %2$s.', 'understrap' ),
$the_theme->get( 'Name' ),
'<a href="' . esc_url( __( 'http://understrap.com', 'understrap' ) ) . '">understrap.com</a>'
),
sprintf( // WPCS: XSS ok.
/* translators:*/
esc_html__( 'Version: %1$s', 'understrap' ), $the_theme->get( 'Version' )
esc_html__( 'Version: %1$s', 'understrap' ),
$the_theme->get( 'Version' )
)
);

View File

@ -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(
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;

View File

@ -9,23 +9,28 @@ 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(
$args = wp_parse_args(
$args,
array(
'mid_size' => 2,
'prev_next' => true,
'prev_text' => __('&laquo;', 'understrap'),
'next_text' => __('&raquo;', 'understrap'),
'screen_reader_text' => __('Posts navigation', 'understrap'),
'prev_text' => __( '&laquo;', 'understrap' ),
'next_text' => __( '&raquo;', 'understrap' ),
'screen_reader_text' => __( 'Posts navigation', 'understrap' ),
'type' => 'array',
'current' => max( 1, get_query_var('paged') ),
) );
'current' => max( 1, get_query_var( 'paged' ) ),
)
);
$links = paginate_links($args);
$links = paginate_links( $args );
?>
@ -34,16 +39,14 @@ if ( ! function_exists ( 'understrap_pagination' ) ) {
<ul class="pagination">
<?php
foreach ( $links as $key => $link ) { ?>
<li class="page-item <?php echo strpos( $link, 'current' ) ? 'active' : '' ?>">
foreach ( $links as $key => $link ) {
?>
<li class="page-item <?php echo strpos( $link, 'current' ) ? 'active' : ''; ?>">
<?php echo str_replace( 'page-numbers', 'page-link', $link ); ?>
</li>
<?php } ?>
<?php
}
?>
</ul>

View File

@ -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.

View File

@ -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,14 +30,14 @@ 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' );
@ -49,7 +49,7 @@ if ( ! function_exists( 'understrap_woocommerce_wrapper_start' ) ) {
}
}
if ( ! function_exists( 'understrap_woocommerce_wrapper_end' ) ) {
function understrap_woocommerce_wrapper_end() {
function understrap_woocommerce_wrapper_end() {
echo '</main><!-- #main -->';
get_template_part( 'global-templates/right-sidebar-check' );
echo '</div><!-- .row -->';
@ -69,12 +69,12 @@ function understrap_woocommerce_wrapper_end() {
*
* @return mixed
*/
if ( ! function_exists ( 'understrap_wc_form_field_args' ) ) {
if ( ! function_exists( 'understrap_wc_form_field_args' ) ) {
function understrap_wc_form_field_args( $args, $key, $value = null ) {
// Start field type switch case.
switch ( $args['type'] ) {
/* Targets all select input type elements, except the country and state select input types */
case 'select' :
case 'select':
// Add a class to the field's html element wrapper - woocommerce
// input types (fields) are often wrapped within a <p></p> tag.
$args['class'][] = 'form-group';
@ -90,13 +90,13 @@ if ( ! function_exists ( 'understrap_wc_form_field_args' ) ) {
break;
// By default WooCommerce will populate a select with the country names - $args
// defined for this specific input type targets only the country select element.
case 'country' :
case 'country':
$args['class'][] = 'form-group single-country';
$args['label_class'] = array( 'control-label' );
break;
// By default WooCommerce will populate a select with state names - $args defined
// for this specific input type targets only the country select element.
case 'state' :
case 'state':
// Add class to the field's html element wrapper.
$args['class'][] = 'form-group';
// add class to the form input itself.
@ -108,28 +108,28 @@ if ( ! function_exists ( 'understrap_wc_form_field_args' ) ) {
'aria-hidden' => 'true',
);
break;
case 'password' :
case 'text' :
case 'email' :
case 'tel' :
case 'number' :
case 'password':
case 'text':
case 'email':
case 'tel':
case 'number':
$args['class'][] = 'form-group';
$args['input_class'] = array( 'form-control', 'input-lg' );
$args['label_class'] = array( 'control-label' );
break;
case 'textarea' :
case 'textarea':
$args['input_class'] = array( 'form-control', 'input-lg' );
$args['label_class'] = array( 'control-label' );
break;
case 'checkbox' :
case 'checkbox':
$args['label_class'] = array( 'custom-control custom-checkbox' );
$args['input_class'] = array( 'custom-control-input', 'input-lg' );
break;
case 'radio' :
case 'radio':
$args['label_class'] = array( 'custom-control custom-radio' );
$args['input_class'] = array( 'custom-control-input', 'input-lg' );
break;
default :
default:
$args['class'][] = 'form-group';
$args['input_class'] = array( 'form-control', 'input-lg' );
$args['label_class'] = array( 'control-label' );

View File

@ -18,7 +18,7 @@ if ( ! defined( 'ABSPATH' ) ) {
*/
add_action( 'after_setup_theme', 'understrap_wpcom_setup' );
if ( ! function_exists ( 'understrap_wpcom_setup' ) ) {
if ( ! function_exists( 'understrap_wpcom_setup' ) ) {
function understrap_wpcom_setup() {
global $themecolors;
@ -44,7 +44,7 @@ if ( ! function_exists ( 'understrap_wpcom_setup' ) ) {
*/
add_action( 'wp_enqueue_scripts', 'understrap_wpcom_styles' );
if ( ! function_exists ( 'understrap_wpcom_styles' ) ) {
if ( ! function_exists( 'understrap_wpcom_styles' ) ) {
function understrap_wpcom_styles() {
wp_enqueue_style( 'understrap-wpcom', get_template_directory_uri() . '/inc/style-wpcom.css', array(), '20160411' );
}

View File

@ -67,11 +67,10 @@ $container = get_theme_mod( 'understrap_container_type' );
<!-- Do the right sidebar check -->
<?php get_template_part( 'global-templates/right-sidebar-check' ); ?>
</div><!-- .row -->
</div><!-- Container end -->
</div><!-- #content -->
</div><!-- Wrapper end -->
</div><!-- #index-wrapper -->
<?php get_footer(); ?>

View File

@ -25,10 +25,12 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php the_content(); ?>
<?php
wp_link_pages( array(
wp_link_pages(
array(
'before' => '<div class="page-links">' . __( 'Pages:', 'understrap' ),
'after' => '</div>',
) );
)
);
?>
</div><!-- .entry-content -->

View File

@ -14,8 +14,12 @@ if ( ! defined( 'ABSPATH' ) ) {
<header class="entry-header">
<?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ),
'</a></h2>' ); ?>
<?php
the_title(
sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ),
'</a></h2>'
);
?>
<?php if ( 'post' == get_post_type() ) : ?>

View File

@ -31,10 +31,12 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php the_content(); ?>
<?php
wp_link_pages( array(
wp_link_pages(
array(
'before' => '<div class="page-links">' . __( 'Pages:', 'understrap' ),
'after' => '</div>',
) );
)
);
?>
</div><!-- .entry-content -->

View File

@ -14,8 +14,12 @@ if ( ! defined( 'ABSPATH' ) ) {
<header class="entry-header">
<?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ),
'</a></h2>' ); ?>
<?php
the_title(
sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ),
'</a></h2>'
);
?>
<?php if ( 'post' == get_post_type() ) : ?>
@ -31,15 +35,15 @@ if ( ! defined( 'ABSPATH' ) ) {
<div class="entry-content">
<?php
the_excerpt();
?>
<?php the_excerpt(); ?>
<?php
wp_link_pages( array(
wp_link_pages(
array(
'before' => '<div class="page-links">' . __( 'Pages:', 'understrap' ),
'after' => '</div>',
) );
)
);
?>
</div><!-- .entry-content -->

View File

@ -54,8 +54,8 @@ $container = get_theme_mod( 'understrap_container_type' );
</div><!-- .row -->
</div><!-- Container end -->
</div><!-- #content -->
</div><!-- Wrapper end -->
</div><!-- page-wrapper -->
<?php get_footer(); ?>

View File

@ -14,7 +14,8 @@ if ( ! defined( 'ABSPATH' ) ) {
get_header();
while ( have_posts() ) : the_post();
while ( have_posts() ) :
the_post();
get_template_part( 'loop-templates/content', 'empty' );
endwhile;

View File

@ -32,9 +32,7 @@ $container = get_theme_mod( 'understrap_container_type' );
<?php
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
?>
@ -46,8 +44,8 @@ $container = get_theme_mod( 'understrap_container_type' );
</div><!-- .row end -->
</div><!-- Container end -->
</div><!-- #content -->
</div><!-- Wrapper end -->
</div><!-- #full-width-page-wrapper -->
<?php get_footer(); ?>

View File

@ -51,8 +51,8 @@ $container = get_theme_mod( 'understrap_container_type' );
</div><!-- .row -->
</div><!-- Container end -->
</div><!-- #content -->
</div><!-- Wrapper end -->
</div><!-- #page-wrapper -->
<?php get_footer(); ?>

View File

@ -30,10 +30,15 @@ $container = get_theme_mod( 'understrap_container_type' );
<header class="page-header">
<h1 class="page-title"><?php printf(
/* translators:*/
<h1 class="page-title">
<?php
printf(
/* translators: %s: query term */
esc_html__( 'Search Results for: %s', 'understrap' ),
'<span>' . get_search_query() . '</span>' ); ?></h1>
'<span>' . get_search_query() . '</span>'
);
?>
</h1>
</header><!-- .page-header -->
@ -67,8 +72,8 @@ $container = get_theme_mod( 'understrap_container_type' );
</div><!-- .row -->
</div><!-- Container end -->
</div><!-- #content -->
</div><!-- Wrapper end -->
</div><!-- #search-wrapper -->
<?php get_footer(); ?>

View File

@ -1,6 +1,6 @@
<?php
/**
* The template for displaying search forms in Underscores.me
* The template for displaying search forms
*
* @package understrap
*/

View File

@ -40,8 +40,8 @@ if ( ! defined( 'ABSPATH' ) ) {
</div><!-- .carousel -->
<script>
jQuery( ".carousel-item" ).first().addClass( "active" );
</script>
<script>
jQuery( ".carousel-item" ).first().addClass( "active" );
</script>
<?php endif; ?>

View File

@ -18,10 +18,10 @@ $sidebar_pos = get_theme_mod( 'understrap_sidebar_position' );
?>
<?php if ( 'both' === $sidebar_pos ) : ?>
<div class="col-md-3 widget-area" id="left-sidebar" role="complementary">
<?php else : ?>
<div class="col-md-4 widget-area" id="left-sidebar" role="complementary">
<?php endif; ?>
<div class="col-md-3 widget-area" id="left-sidebar" role="complementary">
<?php else : ?>
<div class="col-md-4 widget-area" id="left-sidebar" role="complementary">
<?php endif; ?>
<?php dynamic_sidebar( 'left-sidebar' ); ?>
</div><!-- #left-sidebar -->

View File

@ -18,10 +18,10 @@ $sidebar_pos = get_theme_mod( 'understrap_sidebar_position' );
?>
<?php if ( 'both' === $sidebar_pos ) : ?>
<div class="col-md-3 widget-area" id="right-sidebar" role="complementary">
<?php else : ?>
<div class="col-md-4 widget-area" id="right-sidebar" role="complementary">
<?php endif; ?>
<div class="col-md-3 widget-area" id="right-sidebar" role="complementary">
<?php else : ?>
<div class="col-md-4 widget-area" id="right-sidebar" role="complementary">
<?php endif; ?>
<?php dynamic_sidebar( 'right-sidebar' ); ?>
</div><!-- #right-sidebar -->

View File

@ -5,11 +5,11 @@
* @package understrap
*/
$container = get_theme_mod( 'understrap_container_type' );
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
$container = get_theme_mod( 'understrap_container_type' );
?>
<?php if ( is_active_sidebar( 'statichero' ) ) : ?>

View File

@ -46,8 +46,8 @@ $container = get_theme_mod( 'understrap_container_type' );
</div><!-- .row -->
</div><!-- Container end -->
</div><!-- #content -->
</div><!-- Wrapper end -->
</div><!-- #single-wrapper -->
<?php get_footer(); ?>