Merge pull request #856 from IanDelMar/wpcs
Fix formatting issues - wow...thx @IanDelMar !
This commit is contained in:
commit
b9fc5ef0e1
28
404.php
28
404.php
|
@ -11,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
get_header();
|
||||
|
||||
$container = get_theme_mod( 'understrap_container_type' );
|
||||
$container = get_theme_mod( 'understrap_container_type' );
|
||||
?>
|
||||
|
||||
<div class="wrapper" id="error-404-wrapper">
|
||||
|
@ -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’t be found.',
|
||||
'understrap' ); ?></h1>
|
||||
<h1 class="page-title"><?php esc_html_e( 'Oops! That page can’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(
|
||||
'orderby' => 'count',
|
||||
'order' => 'DESC',
|
||||
'show_count' => 1,
|
||||
'title_li' => '',
|
||||
'number' => 10,
|
||||
) );
|
||||
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(); ?>
|
||||
|
|
14
archive.php
14
archive.php
|
@ -12,10 +12,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
}
|
||||
|
||||
get_header();
|
||||
?>
|
||||
|
||||
<?php
|
||||
$container = get_theme_mod( 'understrap_container_type' );
|
||||
$container = get_theme_mod( 'understrap_container_type' );
|
||||
?>
|
||||
|
||||
<div class="wrapper" id="archive-wrapper">
|
||||
|
@ -64,13 +62,13 @@ $container = get_theme_mod( 'understrap_container_type' );
|
|||
<!-- The pagination component -->
|
||||
<?php understrap_pagination(); ?>
|
||||
|
||||
<!-- Do the right sidebar check -->
|
||||
<?php get_template_part( 'global-templates/right-sidebar-check' ); ?>
|
||||
<!-- Do the right sidebar check -->
|
||||
<?php get_template_part( 'global-templates/right-sidebar-check' ); ?>
|
||||
|
||||
</div> <!-- .row -->
|
||||
</div> <!-- .row -->
|
||||
|
||||
</div><!-- Container end -->
|
||||
</div><!-- #content -->
|
||||
|
||||
</div><!-- Wrapper end -->
|
||||
</div><!-- #archive-wrapper -->
|
||||
|
||||
<?php get_footer(); ?>
|
||||
|
|
67
author.php
67
author.php
|
@ -12,10 +12,9 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
}
|
||||
|
||||
get_header();
|
||||
$container = get_theme_mod( 'understrap_container_type' );
|
||||
$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,32 +29,36 @@ $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; ?>
|
||||
|
||||
<dl>
|
||||
<?php if ( ! empty( $curauth->user_url ) ) : ?>
|
||||
<dt><?php esc_html_e( 'Website', 'understrap' ); ?></dt>
|
||||
<dd>
|
||||
<a href="<?php echo esc_url( $curauth->user_url ); ?>"><?php echo esc_html( $curauth->user_url ); ?></a>
|
||||
</dd>
|
||||
<?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>
|
||||
<dd>
|
||||
<a href="<?php echo esc_url( $curauth->user_url ); ?>"><?php echo esc_html( $curauth->user_url ); ?></a>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! empty( $curauth->user_description ) ) : ?>
|
||||
<dt><?php esc_html_e( 'Profile', 'understrap' ); ?></dt>
|
||||
<dd><?php echo esc_html( $curauth->user_description ); ?></dd>
|
||||
<?php endif; ?>
|
||||
</dl>
|
||||
<?php if ( ! empty( $curauth->user_description ) ) : ?>
|
||||
<dt><?php esc_html_e( 'Profile', 'understrap' ); ?></dt>
|
||||
<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; ?>
|
||||
|
||||
|
@ -88,13 +97,13 @@ $container = get_theme_mod( 'understrap_container_type' );
|
|||
<!-- The pagination component -->
|
||||
<?php understrap_pagination(); ?>
|
||||
|
||||
<!-- Do the right sidebar check -->
|
||||
<?php get_template_part( 'global-templates/right-sidebar-check' ); ?>
|
||||
<!-- Do the right sidebar check -->
|
||||
<?php get_template_part( 'global-templates/right-sidebar-check' ); ?>
|
||||
|
||||
</div> <!-- .row -->
|
||||
</div> <!-- .row -->
|
||||
|
||||
</div><!-- Container end -->
|
||||
</div><!-- #content -->
|
||||
|
||||
</div><!-- Wrapper end -->
|
||||
</div><!-- #author-wrapper -->
|
||||
|
||||
<?php get_footer(); ?>
|
||||
|
|
82
comments.php
82
comments.php
|
@ -31,27 +31,27 @@ if ( post_password_required() ) {
|
|||
<h2 class="comments-title">
|
||||
|
||||
<?php
|
||||
$comments_number = get_comments_number();
|
||||
if ( 1 === (int)$comments_number ) {
|
||||
printf(
|
||||
/* translators: %s: post title */
|
||||
esc_html_x( 'One thought on “%s”', 'comments title', 'understrap' ),
|
||||
'<span>' . get_the_title() . '</span>'
|
||||
);
|
||||
} else {
|
||||
printf( // WPCS: XSS OK.
|
||||
/* translators: 1: number of comments, 2: post title */
|
||||
esc_html( _nx(
|
||||
'%1$s thought on “%2$s”',
|
||||
'%1$s thoughts on “%2$s”',
|
||||
$comments_number,
|
||||
'comments title',
|
||||
'understrap'
|
||||
) ),
|
||||
number_format_i18n( $comments_number ),
|
||||
'<span>' . get_the_title() . '</span>'
|
||||
);
|
||||
}
|
||||
$comments_number = get_comments_number();
|
||||
if ( 1 === (int) $comments_number ) {
|
||||
printf(
|
||||
/* translators: %s: post title */
|
||||
esc_html_x( 'One thought on “%s”', 'comments title', 'understrap' ),
|
||||
'<span>' . get_the_title() . '</span>'
|
||||
);
|
||||
} else {
|
||||
printf( // WPCS: XSS OK.
|
||||
/* translators: 1: number of comments, 2: post title */
|
||||
esc_html( _nx(
|
||||
'%1$s thought on “%2$s”',
|
||||
'%1$s thoughts on “%2$s”',
|
||||
$comments_number,
|
||||
'comments title',
|
||||
'understrap'
|
||||
) ),
|
||||
number_format_i18n( $comments_number ),
|
||||
'<span>' . get_the_title() . '</span>'
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
||||
</h2><!-- .comments-title -->
|
||||
|
@ -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( __( '← Older Comments',
|
||||
'understrap' ) ); ?></div>
|
||||
<?php }
|
||||
if ( get_next_comments_link() ) { ?>
|
||||
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →',
|
||||
'understrap' ) ); ?></div>
|
||||
<div class="nav-previous">
|
||||
<?php previous_comments_link( __( '← Older Comments', 'understrap' ) ); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( get_next_comments_link() ) { ?>
|
||||
<div class="nav-next">
|
||||
<?php next_comments_link( __( 'Newer Comments →', 'understrap' ) ); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</nav><!-- #comment-nav-above -->
|
||||
|
@ -78,10 +81,12 @@ if ( post_password_required() ) {
|
|||
<ol class="comment-list">
|
||||
|
||||
<?php
|
||||
wp_list_comments( array(
|
||||
'style' => 'ol',
|
||||
'short_ping' => true,
|
||||
) );
|
||||
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( __( '← Older Comments',
|
||||
'understrap' ) ); ?></div>
|
||||
<?php }
|
||||
if ( get_next_comments_link() ) { ?>
|
||||
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →',
|
||||
'understrap' ) ); ?></div>
|
||||
<div class="nav-previous">
|
||||
<?php previous_comments_link( __( '← Older Comments', 'understrap' ) ); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( get_next_comments_link() ) { ?>
|
||||
<div class="nav-next">
|
||||
<?php next_comments_link( __( 'Newer Comments →', 'understrap' ) ); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</nav><!-- #comment-nav-below -->
|
||||
|
|
|
@ -8,14 +8,12 @@
|
|||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
$sidebar_pos = get_theme_mod( 'understrap_sidebar_position' );
|
||||
?>
|
||||
|
||||
<?php if ( 'left' === $sidebar_pos || 'both' === $sidebar_pos ) : ?>
|
||||
<?php get_template_part( 'sidebar-templates/sidebar', 'left' ); ?>
|
||||
<?php get_template_part( 'sidebar-templates/sidebar', 'left' ); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="col-md content-area" id="primary">
|
||||
|
|
|
@ -16,6 +16,6 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
<?php if ( 'right' === $sidebar_pos || 'both' === $sidebar_pos ) : ?>
|
||||
|
||||
<?php get_template_part( 'sidebar-templates/sidebar', 'right' ); ?>
|
||||
<?php get_template_part( 'sidebar-templates/sidebar', 'right' ); ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
|
|
@ -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' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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'
|
||||
)
|
||||
);
|
||||
$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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
$settings['style_formats'] = json_encode( $style_formats );
|
||||
return $settings;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
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' );
|
||||
|
|
|
@ -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();
|
||||
/**
|
||||
* Add site info content.
|
||||
*/
|
||||
function understrap_add_site_info() {
|
||||
$the_theme = wp_get_theme();
|
||||
|
||||
$site_info = sprintf(
|
||||
'<a href="%1$s">%2$s</a><span class="sep"> | </span>%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' ), '<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' )
|
||||
)
|
||||
);
|
||||
$site_info = sprintf(
|
||||
'<a href="%1$s">%2$s</a><span class="sep"> | </span>%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' ),
|
||||
'<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' )
|
||||
)
|
||||
);
|
||||
|
||||
echo apply_filters( 'understrap_site_info_content', $site_info ); // WPCS: XSS ok.
|
||||
}
|
||||
echo apply_filters( 'understrap_site_info_content', $site_info ); // WPCS: XSS ok.
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 );
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
<nav aria-label="<?php echo $args['screen_reader_text']; ?>">
|
||||
<nav aria-label="<?php echo $args['screen_reader_text']; ?>">
|
||||
|
||||
<ul class="pagination">
|
||||
<ul class="pagination">
|
||||
|
||||
<?php
|
||||
<?php
|
||||
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
|
||||
}
|
||||
?>
|
||||
|
||||
foreach ( $links as $key => $link ) { ?>
|
||||
</ul>
|
||||
|
||||
<li class="page-item <?php echo strpos( $link, 'current' ) ? 'active' : '' ?>">
|
||||
</nav>
|
||||
|
||||
<?php echo str_replace( 'page-numbers', 'page-link', $link ); ?>
|
||||
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
|
||||
<?php
|
||||
}
|
||||
<?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.
|
||||
|
|
|
@ -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 '<div class="wrapper" id="woocommerce-wrapper">';
|
||||
echo '<div class="' . esc_attr( $container ) . '" id="content" tabindex="-1">';
|
||||
echo '<div class="' . esc_attr( $container ) . '" id="content" tabindex="-1">';
|
||||
echo '<div class="row">';
|
||||
get_template_part( 'global-templates/left-sidebar-check' );
|
||||
echo '<main class="site-main" id="main">';
|
||||
}
|
||||
}
|
||||
if ( ! function_exists( 'understrap_woocommerce_wrapper_end' ) ) {
|
||||
function understrap_woocommerce_wrapper_end() {
|
||||
echo '</main><!-- #main -->';
|
||||
get_template_part( 'global-templates/right-sidebar-check' );
|
||||
echo '</div><!-- .row -->';
|
||||
echo '</div><!-- Container end -->';
|
||||
echo '</div><!-- Wrapper end -->';
|
||||
function understrap_woocommerce_wrapper_end() {
|
||||
echo '</main><!-- #main -->';
|
||||
get_template_part( 'global-templates/right-sidebar-check' );
|
||||
echo '</div><!-- .row -->';
|
||||
echo '</div><!-- Container end -->';
|
||||
echo '</div><!-- Wrapper end -->';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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' );
|
||||
|
|
|
@ -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' );
|
||||
}
|
||||
|
|
13
index.php
13
index.php
|
@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
get_header();
|
||||
|
||||
$container = get_theme_mod( 'understrap_container_type' );
|
||||
$container = get_theme_mod( 'understrap_container_type' );
|
||||
?>
|
||||
|
||||
<?php if ( is_front_page() && is_home() ) : ?>
|
||||
|
@ -64,14 +64,13 @@ $container = get_theme_mod( 'understrap_container_type' );
|
|||
<!-- The pagination component -->
|
||||
<?php understrap_pagination(); ?>
|
||||
|
||||
<!-- Do the right sidebar check -->
|
||||
<?php get_template_part( 'global-templates/right-sidebar-check' ); ?>
|
||||
<!-- Do the right sidebar check -->
|
||||
<?php get_template_part( 'global-templates/right-sidebar-check' ); ?>
|
||||
|
||||
</div><!-- .row -->
|
||||
|
||||
</div><!-- .row -->
|
||||
</div><!-- #content -->
|
||||
|
||||
</div><!-- Container end -->
|
||||
|
||||
</div><!-- Wrapper end -->
|
||||
</div><!-- #index-wrapper -->
|
||||
|
||||
<?php get_footer(); ?>
|
||||
|
|
|
@ -25,10 +25,12 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<?php the_content(); ?>
|
||||
|
||||
<?php
|
||||
wp_link_pages( array(
|
||||
'before' => '<div class="page-links">' . __( 'Pages:', 'understrap' ),
|
||||
'after' => '</div>',
|
||||
) );
|
||||
wp_link_pages(
|
||||
array(
|
||||
'before' => '<div class="page-links">' . __( 'Pages:', 'understrap' ),
|
||||
'after' => '</div>',
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
</div><!-- .entry-content -->
|
||||
|
|
|
@ -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,10 +31,12 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<?php the_content(); ?>
|
||||
|
||||
<?php
|
||||
wp_link_pages( array(
|
||||
'before' => '<div class="page-links">' . __( 'Pages:', 'understrap' ),
|
||||
'after' => '</div>',
|
||||
) );
|
||||
wp_link_pages(
|
||||
array(
|
||||
'before' => '<div class="page-links">' . __( 'Pages:', 'understrap' ),
|
||||
'after' => '</div>',
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
</div><!-- .entry-content -->
|
||||
|
|
|
@ -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(
|
||||
'before' => '<div class="page-links">' . __( 'Pages:', 'understrap' ),
|
||||
'after' => '</div>',
|
||||
) );
|
||||
wp_link_pages(
|
||||
array(
|
||||
'before' => '<div class="page-links">' . __( 'Pages:', 'understrap' ),
|
||||
'after' => '</div>',
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
</div><!-- .entry-content -->
|
||||
|
|
|
@ -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(); ?>
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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(); ?>
|
||||
|
|
12
page.php
12
page.php
|
@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
get_header();
|
||||
|
||||
$container = get_theme_mod( 'understrap_container_type' );
|
||||
$container = get_theme_mod( 'understrap_container_type' );
|
||||
|
||||
?>
|
||||
|
||||
|
@ -46,13 +46,13 @@ $container = get_theme_mod( 'understrap_container_type' );
|
|||
|
||||
</main><!-- #main -->
|
||||
|
||||
<!-- Do the right sidebar check -->
|
||||
<?php get_template_part( 'global-templates/right-sidebar-check' ); ?>
|
||||
<!-- Do the right sidebar check -->
|
||||
<?php get_template_part( 'global-templates/right-sidebar-check' ); ?>
|
||||
|
||||
</div><!-- .row -->
|
||||
</div><!-- .row -->
|
||||
|
||||
</div><!-- Container end -->
|
||||
</div><!-- #content -->
|
||||
|
||||
</div><!-- Wrapper end -->
|
||||
</div><!-- #page-wrapper -->
|
||||
|
||||
<?php get_footer(); ?>
|
||||
|
|
25
search.php
25
search.php
|
@ -11,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
get_header();
|
||||
|
||||
$container = get_theme_mod( 'understrap_container_type' );
|
||||
$container = get_theme_mod( 'understrap_container_type' );
|
||||
|
||||
?>
|
||||
|
||||
|
@ -30,10 +30,15 @@ $container = get_theme_mod( 'understrap_container_type' );
|
|||
|
||||
<header class="page-header">
|
||||
|
||||
<h1 class="page-title"><?php printf(
|
||||
/* translators:*/
|
||||
esc_html__( 'Search Results for: %s', 'understrap' ),
|
||||
'<span>' . get_search_query() . '</span>' ); ?></h1>
|
||||
<h1 class="page-title">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: query term */
|
||||
esc_html__( 'Search Results for: %s', 'understrap' ),
|
||||
'<span>' . get_search_query() . '</span>'
|
||||
);
|
||||
?>
|
||||
</h1>
|
||||
|
||||
</header><!-- .page-header -->
|
||||
|
||||
|
@ -62,13 +67,13 @@ $container = get_theme_mod( 'understrap_container_type' );
|
|||
<!-- The pagination component -->
|
||||
<?php understrap_pagination(); ?>
|
||||
|
||||
<!-- Do the right sidebar check -->
|
||||
<?php get_template_part( 'global-templates/right-sidebar-check' ); ?>
|
||||
<!-- Do the right sidebar check -->
|
||||
<?php get_template_part( 'global-templates/right-sidebar-check' ); ?>
|
||||
|
||||
</div><!-- .row -->
|
||||
</div><!-- .row -->
|
||||
|
||||
</div><!-- Container end -->
|
||||
</div><!-- #content -->
|
||||
|
||||
</div><!-- Wrapper end -->
|
||||
</div><!-- #search-wrapper -->
|
||||
|
||||
<?php get_footer(); ?>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* The template for displaying search forms in Underscores.me
|
||||
* The template for displaying search forms
|
||||
*
|
||||
* @package understrap
|
||||
*/
|
||||
|
@ -18,6 +18,6 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<span class="input-group-append">
|
||||
<input class="submit btn btn-primary" id="searchsubmit" name="submit" type="submit"
|
||||
value="<?php esc_attr_e( 'Search', 'understrap' ); ?>">
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
@ -14,34 +14,34 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
<!-- ******************* The Hero Widget Area ******************* -->
|
||||
|
||||
<div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
|
||||
<div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
|
||||
|
||||
<div class="carousel-inner" role="listbox">
|
||||
<div class="carousel-inner" role="listbox">
|
||||
|
||||
<?php dynamic_sidebar( 'hero' ); ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
|
||||
<a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
|
||||
|
||||
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
||||
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
||||
|
||||
<span class="sr-only"><?php esc_html_e( 'Previous', 'understrap' ); ?></span>
|
||||
<span class="sr-only"><?php esc_html_e( 'Previous', 'understrap' ); ?></span>
|
||||
|
||||
</a>
|
||||
</a>
|
||||
|
||||
<a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
|
||||
<a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
|
||||
|
||||
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
||||
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
||||
|
||||
<span class="sr-only"><?php esc_html_e( 'Next', 'understrap' ); ?></span>
|
||||
<span class="sr-only"><?php esc_html_e( 'Next', 'understrap' ); ?></span>
|
||||
|
||||
</a>
|
||||
</a>
|
||||
|
||||
</div><!-- .carousel -->
|
||||
</div><!-- .carousel -->
|
||||
|
||||
<script>
|
||||
jQuery( ".carousel-item" ).first().addClass( "active" );
|
||||
</script>
|
||||
<script>
|
||||
jQuery( ".carousel-item" ).first().addClass( "active" );
|
||||
</script>
|
||||
|
||||
<?php endif; ?>
|
||||
|
|
|
@ -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 -->
|
||||
|
|
|
@ -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 -->
|
||||
|
|
|
@ -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' ) ) : ?>
|
||||
|
|
14
single.php
14
single.php
|
@ -10,7 +10,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
}
|
||||
|
||||
get_header();
|
||||
$container = get_theme_mod( 'understrap_container_type' );
|
||||
$container = get_theme_mod( 'understrap_container_type' );
|
||||
?>
|
||||
|
||||
<div class="wrapper" id="single-wrapper">
|
||||
|
@ -28,7 +28,7 @@ $container = get_theme_mod( 'understrap_container_type' );
|
|||
|
||||
<?php get_template_part( 'loop-templates/content', 'single' ); ?>
|
||||
|
||||
<?php understrap_post_nav(); ?>
|
||||
<?php understrap_post_nav(); ?>
|
||||
|
||||
<?php
|
||||
// If comments are open or we have at least one comment, load up the comment template.
|
||||
|
@ -41,13 +41,13 @@ $container = get_theme_mod( 'understrap_container_type' );
|
|||
|
||||
</main><!-- #main -->
|
||||
|
||||
<!-- Do the right sidebar check -->
|
||||
<?php get_template_part( 'global-templates/right-sidebar-check' ); ?>
|
||||
<!-- Do the right sidebar check -->
|
||||
<?php get_template_part( 'global-templates/right-sidebar-check' ); ?>
|
||||
|
||||
</div><!-- .row -->
|
||||
</div><!-- .row -->
|
||||
|
||||
</div><!-- Container end -->
|
||||
</div><!-- #content -->
|
||||
|
||||
</div><!-- Wrapper end -->
|
||||
</div><!-- #single-wrapper -->
|
||||
|
||||
<?php get_footer(); ?>
|
||||
|
|
Reference in New Issue