Merge pull request #106 from maxdmyers/code-standards

Implement @mdo's code standards as per feature request
You are great! Two thumb up  👍  👍 @maxdmyers
This commit is contained in:
Holger 2016-11-01 20:07:41 +01:00 committed by GitHub
commit b8a5f0cc5a
36 changed files with 993 additions and 1019 deletions

84
404.php
View File

@ -4,73 +4,75 @@
* @package understrap * @package understrap
*/ */
get_header(); ?> get_header();
?>
<div class="wrapper" id="404-wrapper"> <div class="wrapper" id="404-wrapper">
<div id="content" class="container"> <div class="container" id="content">
<div class="row"> <div class="row">
<div id="primary" class="content-area"> <div class="content-area" id="primary">
<main id="main" class="site-main" role="main"> <main class="site-main" id="main" role="main">
<section class="error-404 not-found"> <section class="error-404 not-found">
<header class="page-header"> <header class="page-header">
<h1 class="page-title"><?php _e( 'Oops! That page can&rsquo;t be found.', 'understrap' ); ?></h1> <h1 class="page-title"><?php _e( 'Oops! That page can&rsquo;t be found.', 'understrap' ); ?></h1>
</header><!-- .page-header -->
<div class="page-content"> </header><!-- .page-header -->
<p><?php _e( 'It looks like nothing was found at this location. Maybe try one of the links below or a search?', 'understrap' ); ?></p> <div class="page-content">
<?php get_search_form(); ?> <p><?php _e( 'It looks like nothing was found at this location. Maybe try one of the links below or a search?', 'understrap' ); ?></p>
<?php the_widget( 'WP_Widget_Recent_Posts' ); ?> <?php get_search_form(); ?>
<?php if ( understrap_categorized_blog() ) : // Only show the widget if site has multiple categories. ?> <?php the_widget( 'WP_Widget_Recent_Posts' ); ?>
<div class="widget widget_categories"> <?php if ( understrap_categorized_blog() ) : // Only show the widget if site has multiple categories. ?>
<h2 class="widget-title"><?php _e( 'Most Used Categories', 'understrap' ); ?></h2> <div class="widget widget_categories">
<ul> <h2 class="widget-title"><?php _e( 'Most Used Categories', 'understrap' ); ?></h2>
<?php
wp_list_categories( array(
'orderby' => 'count',
'order' => 'DESC',
'show_count' => 1,
'title_li' => '',
'number' => 10,
) );
?>
</ul>
</div><!-- .widget --> <ul>
<?php
wp_list_categories( array(
'orderby' => 'count',
'order' => 'DESC',
'show_count' => 1,
'title_li' => '',
'number' => 10,
) );
?>
</ul>
<?php endif; ?> </div><!-- .widget -->
<?php <?php endif; ?>
/* translators: %1$s: smiley */
$archive_content = '<p>' . sprintf( __( 'Try looking in the monthly archives. %1$s', 'understrap' ), convert_smilies( ':)' ) ) . '</p>';
the_widget( 'WP_Widget_Archives', 'dropdown=1', "after_title=</h2>$archive_content" );
?>
<?php the_widget( 'WP_Widget_Tag_Cloud' ); ?> <?php
/* translators: %1$s: smiley */
$archive_content = '<p>' . sprintf( __( 'Try looking in the monthly archives. %1$s', 'understrap' ), convert_smilies( ':)' ) ) . '</p>';
the_widget( 'WP_Widget_Archives', 'dropdown=1', "after_title=</h2>$archive_content" );
?>
</div><!-- .page-content --> <?php the_widget( 'WP_Widget_Tag_Cloud' ); ?>
</section><!-- .error-404 --> </div><!-- .page-content -->
</main><!-- #main --> </section><!-- .error-404 -->
</div><!-- #primary --> </main><!-- #main -->
</div> <!-- .row --> </div><!-- #primary -->
</div><!-- Container end --> </div> <!-- .row -->
</div><!-- Container end -->
</div><!-- Wrapper end --> </div><!-- Wrapper end -->

View File

@ -7,57 +7,58 @@
* @package understrap * @package understrap
*/ */
get_header(); ?> get_header();
?>
<div class="wrapper" id="archive-wrapper"> <div class="wrapper" id="archive-wrapper">
<div id="content" class="container"> <div class="container" id="content">
<div class="row"> <div class="row">
<div id="primary" class="<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area"> <div class="<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area" id="primary">
<main id="main" class="site-main" role="main"> <main class="site-main" id="main" role="main">
<?php if ( have_posts() ) : ?> <?php if ( have_posts() ) : ?>
<header class="page-header"> <header class="page-header">
<?php <?php
the_archive_title( '<h1 class="page-title">', '</h1>' ); the_archive_title( '<h1 class="page-title">', '</h1>' );
the_archive_description( '<div class="taxonomy-description">', '</div>' ); the_archive_description( '<div class="taxonomy-description">', '</div>' );
?> ?>
</header><!-- .page-header --> </header><!-- .page-header -->
<?php /* Start the Loop */ ?> <?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?> <?php while ( have_posts() ) : the_post(); ?>
<?php <?php
/* Include the Post-Format-specific template for the content. /* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file * If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead. * called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/ */
get_template_part( 'loop-templates/content', get_post_format() ); get_template_part( 'loop-templates/content', get_post_format() );
?> ?>
<?php endwhile; ?> <?php endwhile; ?>
<?php the_posts_navigation(); ?> <?php the_posts_navigation(); ?>
<?php else : ?> <?php else : ?>
<?php get_template_part( 'loop-templates/content', 'none' ); ?> <?php get_template_part( 'loop-templates/content', 'none' ); ?>
<?php endif; ?> <?php endif; ?>
</main><!-- #main --> </main><!-- #main -->
</div><!-- #primary --> </div><!-- #primary -->
<?php get_sidebar(); ?> <?php get_sidebar(); ?>
</div> <!-- .row --> </div> <!-- .row -->
</div><!-- Container end --> </div><!-- Container end -->
</div><!-- Wrapper end --> </div><!-- Wrapper end -->

View File

@ -6,79 +6,80 @@
* *
* @package understrap * @package understrap
*/ */
get_header(); ?> get_header();
?>
<div class="wrapper" id="author-wrapper"> <div class="wrapper" id="author-wrapper">
<div id="content" class="container"> <div class="container" id="content">
<div class="row"> <div class="row">
<div id="primary" class="<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area"> <div class="<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area" id="primary">
<main id="main" class="site-main" role="main"> <main class="site-main" id="main" role="main">
<header class="page-header author-header"> <header class="page-header author-header">
<?php <?php
$curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author)); $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
?> ?>
<h1><?php esc_html_e( 'About:', 'understrap' ); ?> <?php echo $curauth->nickname; ?></h1> <h1><?php esc_html_e( 'About:', 'understrap' ); ?> <?php echo $curauth->nickname; ?></h1>
<?php if ( ! empty( $curauth->ID ) ) : ?> <?php if ( ! empty( $curauth->ID ) ) : ?>
<?php echo get_avatar($curauth->ID); ?> <?php echo get_avatar($curauth->ID); ?>
<?php endif; ?> <?php endif; ?>
<dl> <dl>
<?php if ( ! empty( $curauth->user_url ) ) : ?> <?php if ( ! empty( $curauth->user_url ) ) : ?>
<dt><?php esc_html_e( 'Website', 'understrap' ); ?></dt> <dt><?php esc_html_e( 'Website', 'understrap' ); ?></dt>
<dd><a href="<?php echo $curauth->user_url; ?>"><?php echo $curauth->user_url; ?></a></dd> <dd><a href="<?php echo $curauth->user_url; ?>"><?php echo $curauth->user_url; ?></a></dd>
<?php endif; ?> <?php endif; ?>
<?php if ( ! empty( $curauth->user_description ) ) : ?> <?php if ( ! empty( $curauth->user_description ) ) : ?>
<dt><?php esc_html_e( 'Profile', 'understrap' ); ?></dt> <dt><?php esc_html_e( 'Profile', 'understrap' ); ?></dt>
<dd><?php echo $curauth->user_description; ?></dd> <dd><?php echo $curauth->user_description; ?></dd>
<?php endif; ?> <?php endif; ?>
</dl> </dl>
<h2><?php esc_html_e( 'Posts by', 'understrap' ); ?> <?php echo $curauth->nickname; ?>:</h2> <h2><?php esc_html_e( 'Posts by', 'understrap' ); ?> <?php echo $curauth->nickname; ?>:</h2>
</header><!-- .page-header --> </header><!-- .page-header -->
<ul> <ul>
<!-- The Loop -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <!-- The Loop -->
<li> <?php if ( have_posts() ) : ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"> <?php while ( have_posts() ) : the_post(); ?>
<?php the_title(); ?></a>, <li>
<?php the_time('d M Y'); ?> in <?php the_category('&');?> <a rel="bookmark" href="<?php the_permalink() ?>" title="Permanent Link: <?php the_title(); ?>">
</li> <?php the_title(); ?></a>,
<?php the_time('d M Y'); ?> in <?php the_category('&');?>
</li>
<?php endwhile; ?>
<?php endwhile; ?> <?php the_posts_navigation(); ?>
<?php the_posts_navigation(); ?> <?php else : ?>
<?php else : ?> <?php get_template_part( 'loop-templates/content', 'none' ); ?>
<?php get_template_part( 'loop-templates/content', 'none' ); ?> <?php endif; ?>
<?php endif; ?> <!-- End Loop -->
<!-- End Loop --> </ul>
</ul> </main><!-- #main -->
</main><!-- #main --> </div><!-- #primary -->
</div><!-- #primary --> <?php get_sidebar(); ?>
<?php get_sidebar(); ?> </div> <!-- .row -->
</div> <!-- .row --> </div><!-- Container end -->
</div><!-- Container end -->
</div><!-- Wrapper end --> </div><!-- Wrapper end -->

View File

@ -14,70 +14,70 @@
* return early without loading the comments. * return early without loading the comments.
*/ */
if ( post_password_required() ) { if ( post_password_required() ) {
return; return;
} }
?> ?>
<div id="comments" class="comments-area"> <div class="comments-area" id="comments">
<?php // You can start editing here -- including this comment! ?> <?php // You can start editing here -- including this comment! ?>
<?php if ( have_comments() ) : ?> <?php if ( have_comments() ) : ?>
<h2 class="comments-title"> <h2 class="comments-title">
<?php <?php
printf( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'understrap' ), printf( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'understrap' ),
number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' ); number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
?> ?>
</h2> </h2>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
<nav id="comment-nav-above" class="comment-navigation" role="navigation"> <nav class="comment-navigation" id="comment-nav-above" role="navigation">
<h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'understrap' ); ?></h1> <h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'understrap' ); ?></h1>
<?php if ( get_previous_comments_link() ) { ?> <?php if ( get_previous_comments_link() ) { ?>
<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'understrap' ) ); ?></div> <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'understrap' ) ); ?></div>
<?php } <?php } if ( get_next_comments_link() ) { ?>
if ( get_next_comments_link() ) { ?> <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'understrap' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'understrap' ) ); ?></div> <?php } ?>
<?php } ?> </nav><!-- #comment-nav-above -->
</nav><!-- #comment-nav-above --> <?php endif; // check for comment navigation ?>
<?php endif; // check for comment navigation ?>
<ol class="comment-list"> <ol class="comment-list">
<?php <?php
wp_list_comments( array( wp_list_comments( array(
'style' => 'ol', 'style' => 'ol',
'short_ping' => true, 'short_ping' => true,
) ); ) );
?> ?>
</ol><!-- .comment-list --> </ol><!-- .comment-list -->
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
<nav id="comment-nav-below" class="comment-navigation" role="navigation"> <nav class="comment-navigation" id="comment-nav-below" role="navigation">
<h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'understrap' ); ?></h1> <h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'understrap' ); ?></h1>
<?php if ( get_previous_comments_link() ) { ?> <?php if ( get_previous_comments_link() ) { ?>
<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'understrap' ) ); ?></div> <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'understrap' ) );?></div>
<?php } <?php } if ( get_next_comments_link() ) { ?>
if ( get_next_comments_link() ) { ?> <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'understrap' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'understrap' ) ); ?></div> <?php } ?>
<?php } ?> </nav><!-- #comment-nav-below -->
</nav><!-- #comment-nav-below --> <?php endif; // check for comment navigation ?>
<?php endif; // check for comment navigation ?>
<?php endif; // have_comments() ?> <?php endif; // have_comments() ?>
<?php <?php
// If comments are closed and there are comments, let's leave a little note, shall we? // If comments are closed and there are comments, let's leave a little note, shall we?
if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
?> ?>
<p class="no-comments"><?php _e( 'Comments are closed.', 'understrap' ); ?></p>
<?php endif; ?>
<?php <p class="no-comments"><?php _e( 'Comments are closed.', 'understrap' ); ?></p>
/* Loads the comment-form.php template
/* get_template_part('comment-form');
*/
?>
<?php comment_form(); ?> <?php endif; ?>
<?php
/* Loads the comment-form.php template
/* get_template_part('comment-form');
*/
?>
<?php comment_form(); ?>
</div><!-- #comments --> </div><!-- #comments -->

View File

@ -4907,13 +4907,16 @@ a.text-gray-dark:focus, a.text-gray-dark:hover {
#wrapper-hero { #wrapper-hero {
padding: 0px !important; } padding: 0px !important; }
.sticky, .gallery-caption, .bypostauthor { .sticky,
.gallery-caption,
.bypostauthor {
font-size: inherit; } font-size: inherit; }
.wrapper#wrapper-sticky { .wrapper#wrapper-sticky {
border-bottom: 1px solid #818a91; } border-bottom: 1px solid #818a91; }
#wrapper-footer-full, #wrapper-static-hero { #wrapper-footer-full,
#wrapper-static-hero {
background-color: #eceeef; } background-color: #eceeef; }
.wp-caption { .wp-caption {
@ -4939,13 +4942,17 @@ a.text-gray-dark:focus, a.text-gray-dark:hover {
.entry-footer span { .entry-footer span {
padding-right: 10px; } padding-right: 10px; }
img.wp-post-image, article img, figure, img, #secondary img { img.wp-post-image,
article img,
figure,
img,
#secondary img {
max-width: 100%; max-width: 100%;
height: auto; } height: auto; }
a.skip-link { a.skip-link {
z-index: 1000;
position: fixed; position: fixed;
z-index: 1000;
top: 0px; top: 0px;
right: 0px; } right: 0px; }
@ -4954,9 +4961,14 @@ a.skip-link {
.menu-item { .menu-item {
float: left; float: left;
width: auto; display: inline;
display: inline; } width: auto; }
/* Navbar toggle
* Custom button for toggling the `.navbar-collapse`, powered by the collapse
* JavaScript plugin.
* Navbar vertical align
*/
.navbar-toggle { .navbar-toggle {
position: relative; position: relative;
float: right; float: right;
@ -4964,7 +4976,10 @@ a.skip-link {
padding: 9px 10px; padding: 9px 10px;
background-color: transparent; background-color: transparent;
background-image: none; background-image: none;
border: 1px solid transparent; } border: 1px solid transparent;
/*
* We remove the `outline` here, but later compensate by attaching `:hover` styles to `:focus`.
*/ }
.navbar-toggle:focus { .navbar-toggle:focus {
outline: 0; } outline: 0; }
.navbar-toggle .icon-bar { .navbar-toggle .icon-bar {
@ -4975,9 +4990,10 @@ a.skip-link {
.navbar-toggle .icon-bar + .icon-bar { .navbar-toggle .icon-bar + .icon-bar {
margin-top: 4px; } margin-top: 4px; }
.navbar .collapsing, .navbar .collapse.in { .navbar .collapsing,
width: 100%; .navbar .collapse.in {
float: left; } float: left;
width: 100%; }
.navbar-dark .navbar-toggle { .navbar-dark .navbar-toggle {
border: 1px solid #fff; } border: 1px solid #fff; }
@ -5005,19 +5021,19 @@ a.skip-link {
margin-left: 0rem; } margin-left: 0rem; }
.nav-link { .nav-link {
margin-left: .425rem; margin-right: .425rem;
margin-right: .425rem; } margin-left: .425rem; }
.dropdown-menu .dropdown-menu { .dropdown-menu .dropdown-menu {
position: relative; position: relative;
display: block; display: block;
border: none; width: 140px;
box-shadow: none;
margin-left: 10px; margin-left: 10px;
width: 140px; } border: none;
box-shadow: none; }
.dropdown-menu .dropdown-menu li { .dropdown-menu .dropdown-menu li {
list-style: square; padding-left: 0px;
padding-left: 0px; } list-style: square; }
.dropdown-menu .menu-item { .dropdown-menu .menu-item {
width: 100%; } width: 100%; }

2
css/theme.min.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6,41 +6,42 @@
* *
* @package understrap * @package understrap
*/ */
$the_theme = wp_get_theme(); $the_theme = wp_get_theme();
?> ?>
<?php get_sidebar('footerfull'); ?> <?php get_sidebar('footerfull'); ?>
<div class="wrapper" id="wrapper-footer"> <div class="wrapper" id="wrapper-footer">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<footer id="colophon" class="site-footer" role="contentinfo"> <footer class="site-footer" id="colophon" role="contentinfo">
<div class="site-info"> <div class="site-info">
<a href="<?php echo esc_url( __( 'http://wordpress.org/', 'understrap' ) ); ?>"><?php printf( __( 'Proudly powered by %s', 'understrap' ), 'WordPress' ); ?></a> <a href="<?php echo esc_url( __( 'http://wordpress.org/', 'understrap' ) ); ?>"><?php printf( __( 'Proudly powered by %s', 'understrap' ), 'WordPress' ); ?></a>
<span class="sep"> | </span> <span class="sep"> | </span>
<?php printf( __( 'Theme: %1$s by %2$s.', 'understrap' ), $the_theme->get( 'Name' ), '<a href="http://understrap.com/" rel="designer">understrap.com</a>' ); ?> <?php printf( __( 'Theme: %1$s by %2$s.', 'understrap' ), $the_theme->get( 'Name' ), '<a rel="designer" href="http://understrap.com/">understrap.com</a>' ); ?>
(<?php printf( __( 'Version: %1$s', 'understrap' ), $the_theme->get( 'Version' ) ); ?>) (<?php printf( __( 'Version: %1$s', 'understrap' ), $the_theme->get( 'Version' ) ); ?>)
</div><!-- .site-info --> </div><!-- .site-info -->
</footer><!-- #colophon --> </footer><!-- #colophon -->
</div><!--col end --> </div><!--col end -->
</div><!-- row end --> </div><!-- row end -->
</div><!-- container end --> </div><!-- container end -->
</div><!-- wrapper end --> </div><!-- wrapper end -->
</div><!-- #page --> </div><!-- #page -->
<?php wp_footer(); ?> <?php wp_footer(); ?>
</body> </body>

View File

@ -62,7 +62,6 @@ require get_template_directory() . '/inc/bootstrap-wp-navwalker.php';
*/ */
require get_template_directory() . '/inc/bootstrap-wp-gallery.php'; require get_template_directory() . '/inc/bootstrap-wp-gallery.php';
/** /**
* Load WooCommerce functions. * Load WooCommerce functions.
*/ */

View File

@ -6,72 +6,62 @@
* *
* @package understrap * @package understrap
*/ */
?><!DOCTYPE html> ?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>> <html <?php language_attributes(); ?>>
<head> <head>
<meta charset="<?php bloginfo( 'charset' ); ?>"> <meta charset="<?php bloginfo( 'charset' ); ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="mobile-web-app-capable" content="yes"> <meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="<?php bloginfo('name'); ?> - <?php bloginfo('description'); ?>"> <meta name="apple-mobile-web-app-title" content="<?php bloginfo('name'); ?> - <?php bloginfo('description'); ?>">
<link rel="profile" href="http://gmpg.org/xfn/11"> <link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php wp_head(); ?> <?php wp_head(); ?>
</head> </head>
<body <?php body_class(); ?>> <body <?php body_class(); ?>>
<div id="page" class="hfeed site"> <div class="hfeed site" id="page">
<!-- ******************* The Navbar Area ******************* --> <!-- ******************* The Navbar Area ******************* -->
<div class="wrapper-fluid wrapper-navbar" id="wrapper-navbar"> <div class="wrapper-fluid wrapper-navbar" id="wrapper-navbar">
<a class="skip-link screen-reader-text sr-only" href="#content"><?php _e( 'Skip to content', 'understrap' ); ?></a> <a class="skip-link screen-reader-text sr-only" href="#content"><?php _e( 'Skip to content', 'understrap' ); ?></a>
<nav class="navbar navbar-dark bg-inverse site-navigation" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement"> <nav class="navbar navbar-dark bg-inverse site-navigation" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement">
<div class="container">
<div class="container"> <div class="navbar-header">
<!-- .navbar-toggle is used as the toggle for collapsed navbar content -->
<button class="navbar-toggler hidden-sm-up" data-toggle="collapse" data-target=".exCollapsingNavbar" type="button" aria-controls="exCollapsingNavbar" aria-expanded="false" aria-label="Toggle navigation">&#9776;</button>
<div class="navbar-header"> <!-- Your site title as branding in the menu -->
<?php if (!has_custom_logo()) { ?>
<a class="navbar-brand" rel="home" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>">
<?php bloginfo( 'name' ); ?>
</a>
<?php } else { the_custom_logo(); } ?><!-- end custom logo -->
<!-- .navbar-toggle is used as the toggle for collapsed navbar content --> </div>
<button class="navbar-toggler hidden-sm-up" type="button" data-toggle="collapse" data-target=".exCollapsingNavbar" aria-controls="exCollapsingNavbar" aria-expanded="false" aria-label="Toggle navigation"> <!-- The WordPress Menu goes here -->
&#9776; <?php wp_nav_menu(
</button> array(
'theme_location' => 'primary',
'container_class' => 'collapse navbar-toggleable-xs exCollapsingNavbar',
'menu_class' => 'nav navbar-nav',
'fallback_cb' => '',
'menu_id' => 'main-menu',
'walker' => new wp_bootstrap_navwalker()
)
); ?>
<!-- Your site title as branding in the menu --> </div> <!-- .container -->
<?php if (!has_custom_logo()) { ?>
<a class="navbar-brand" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<?php bloginfo( 'name' ); ?>
</a>
<?php } else { the_custom_logo(); } ?><!-- end custom logo -->
</div> </nav><!-- .site-navigation -->
<!-- The WordPress Menu goes here -->
<?php wp_nav_menu(
array(
'theme_location' => 'primary',
'container_class' => 'collapse navbar-toggleable-xs exCollapsingNavbar',
'menu_class' => 'nav navbar-nav',
'fallback_cb' => '',
'menu_id' => 'main-menu',
'walker' => new wp_bootstrap_navwalker()
)
); ?>
</div> <!-- .container -->
</nav><!-- .site-navigation -->
</div><!-- .wrapper-navbar end --> </div><!-- .wrapper-navbar end -->

View File

@ -4,124 +4,124 @@
function bootstrap_wp_gallery( $output, $attr ) { function bootstrap_wp_gallery( $output, $attr ) {
// Initialize // Initialize
global $post, $wp_locale; global $post, $wp_locale;
// Gallery instance counter // Gallery instance counter
static $instance = 0; static $instance = 0;
$instance++; $instance++;
// Validate the author's orderby attribute // Validate the author's orderby attribute
if ( isset( $attr['orderby'] ) ) { if ( isset( $attr['orderby'] ) ) {
$attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] ); $attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] );
if ( ! $attr['orderby'] ) unset( $attr['orderby'] ); if ( ! $attr['orderby'] ) unset( $attr['orderby'] );
} }
// Get attributes from shortcode // Get attributes from shortcode
extract( shortcode_atts( array( extract( shortcode_atts( array(
'order' => 'ASC', 'order' => 'ASC',
'orderby' => 'menu_order ID', 'orderby' => 'menu_order ID',
'id' => $post->ID, 'id' => $post->ID,
'itemtag' => 'div', 'itemtag' => 'div',
'icontag' => 'div', 'icontag' => 'div',
'captiontag' => 'div', 'captiontag' => 'div',
'columns' => 3, 'columns' => 3,
'size' => 'thumbnail', 'size' => 'thumbnail',
'exclude' => '' 'exclude' => ''
), $attr ) ); ), $attr ) );
// Initialize // Initialize
$id = intval( $id ); $id = intval( $id );
$attachments = array(); $attachments = array();
if ( $order == 'RAND' ) $orderby = 'none'; if ( $order == 'RAND' ) $orderby = 'none';
if ( ! empty( $include ) ) { if ( ! empty( $include ) ) {
// Include attribute is present // Include attribute is present
$include = preg_replace( '/[^0-9,]+/', '', $include ); $include = preg_replace( '/[^0-9,]+/', '', $include );
$_attachments = get_posts( array( 'include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby ) ); $_attachments = get_posts( array( 'include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby ) );
// Setup attachments array // Setup attachments array
foreach ( $_attachments as $key => $val ) { foreach ( $_attachments as $key => $val ) {
$attachments[ $val->ID ] = $_attachments[ $key ]; $attachments[ $val->ID ] = $_attachments[ $key ];
} }
} else if ( ! empty( $exclude ) ) { } else if ( ! empty( $exclude ) ) {
// Exclude attribute is present // Exclude attribute is present
$exclude = preg_replace( '/[^0-9,]+/', '', $exclude ); $exclude = preg_replace( '/[^0-9,]+/', '', $exclude );
// Setup attachments array // Setup attachments array
$attachments = get_children( array( 'post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby ) ); $attachments = get_children( array( 'post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby ) );
} else { } else {
// Setup attachments array // Setup attachments array
$attachments = get_children( array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby ) ); $attachments = get_children( array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby ) );
} }
if ( empty( $attachments ) ) return ''; if ( empty( $attachments ) ) return '';
// Filter gallery differently for feeds // Filter gallery differently for feeds
if ( is_feed() ) { if ( is_feed() ) {
$output = "\n"; $output = "\n";
foreach ( $attachments as $att_id => $attachment ) $output .= wp_get_attachment_link( $att_id, $size, true ) . "\n"; foreach ( $attachments as $att_id => $attachment ) $output .= wp_get_attachment_link( $att_id, $size, true ) . "\n";
return $output; return $output;
} }
// Filter tags and attributes // Filter tags and attributes
$itemtag = tag_escape( $itemtag ); $itemtag = tag_escape( $itemtag );
$captiontag = tag_escape( $captiontag ); $captiontag = tag_escape( $captiontag );
$columns = intval( $columns ); $columns = intval( $columns );
$itemwidth = $columns > 0 ? floor( 12 / $columns ) : 100; $itemwidth = $columns > 0 ? floor( 12 / $columns ) : 100;
$float = is_rtl() ? 'right' : 'left'; $float = is_rtl() ? 'right' : 'left';
$selector = "gallery-{$instance}"; $selector = "gallery-{$instance}";
// Filter gallery CSS // Filter gallery CSS
$output = apply_filters( 'gallery_style', " $output = apply_filters( 'gallery_style', "
<div id='$selector' class='gallery galleryid-{$id} row'>" <div class='gallery galleryid-{$id} row' id='$selector'>"
); );
// Iterate through the attachments in this gallery instance // Iterate through the attachments in this gallery instance
$i = 0; $i = 0;
foreach ( $attachments as $id => $attachment ) { foreach ( $attachments as $id => $attachment ) {
// Attachment link // Attachment link
$link = isset( $attr['link'] ) && 'file' == $attr['link'] ? wp_get_attachment_link( $id, $size, false, false ) : wp_get_attachment_link( $id, $size, true, false ); $link = isset( $attr['link'] ) && 'file' == $attr['link'] ? wp_get_attachment_link( $id, $size, false, false ) : wp_get_attachment_link( $id, $size, true, false );
// Start itemtag // Start itemtag
$output .= "<{$itemtag} class='gallery-item col-md-{$itemwidth}'>"; $output .= "<{$itemtag} class='gallery-item col-md-{$itemwidth}'>";
// icontag // icontag
$output .= " $output .= "
<{$icontag} class='gallery-icon'> <{$icontag} class='gallery-icon'>
$link $link
</{$icontag}>"; </{$icontag}>";
if ( $captiontag && trim( $attachment->post_excerpt ) ) { if ( $captiontag && trim( $attachment->post_excerpt ) ) {
// captiontag // captiontag
$output .= " $output .= "
<{$captiontag} class='gallery-caption'> <{$captiontag} class='gallery-caption'>
" . wptexturize($attachment->post_excerpt) . " " . wptexturize($attachment->post_excerpt) . "
</{$captiontag}>"; </{$captiontag}>";
} }
// End itemtag // End itemtag
$output .= "</{$itemtag}>"; $output .= "</{$itemtag}>";
// Line breaks by columns set // Line breaks by columns set
if($columns > 0 && ++$i % $columns == 0) $output .= '<br style="clear: both">'; if($columns > 0 && ++$i % $columns == 0) $output .= '<br style="clear: both">';
} }
// End gallery output // End gallery output
$output .= " $output .= "
<br style='clear: both;'> <br style='clear: both;'>
</div>\n"; </div>\n";
return $output; return $output;
} }

View File

@ -18,126 +18,126 @@
//exit if accessed directly //exit if accessed directly
if(!defined('ABSPATH')) exit; if(!defined('ABSPATH')) exit;
class wp_bootstrap_navwalker extends Walker_Nav_Menu { class wp_bootstrap_navwalker extends Walker_Nav_Menu {
/** /**
* @see Walker::start_lvl() * @see Walker::start_lvl()
* @since 3.0.0 * @since 3.0.0
* *
* @param string $output Passed by reference. Used to append additional content. * @param string $output Passed by reference. Used to append additional content.
* @param int $depth Depth of page. Used for padding. * @param int $depth Depth of page. Used for padding.
*/ */
public function start_lvl( &$output, $depth = 0, $args = array() ) { public function start_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat( "\t", $depth ); $indent = str_repeat( "\t", $depth );
$output .= "\n$indent<ul role=\"menu\" class=\" dropdown-menu\">\n"; $output .= "\n$indent<ul class=\" dropdown-menu\" role=\"menu\">\n";
} }
/** /**
* @see Walker::start_el() * @see Walker::start_el()
* @since 3.0.0 * @since 3.0.0
* *
* @param string $output Passed by reference. Used to append additional content. * @param string $output Passed by reference. Used to append additional content.
* @param object $item Menu item data object. * @param object $item Menu item data object.
* @param int $depth Depth of menu item. Used for padding. * @param int $depth Depth of menu item. Used for padding.
* @param int $current_page Menu item ID. * @param int $current_page Menu item ID.
* @param object $args * @param object $args
*/ */
public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
/** /**
* Dividers, Headers or Disabled * Dividers, Headers or Disabled
* ============================= * =============================
* Determine whether the item is a Divider, Header, Disabled or regular * Determine whether the item is a Divider, Header, Disabled or regular
* menu item. To prevent errors we use the strcasecmp() function to so a * menu item. To prevent errors we use the strcasecmp() function to so a
* comparison that is not case sensitive. The strcasecmp() function returns * comparison that is not case sensitive. The strcasecmp() function returns
* a 0 if the strings are equal. * a 0 if the strings are equal.
*/ */
if ( strcasecmp( $item->attr_title, 'divider' ) == 0 && $depth === 1 ) { if ( strcasecmp( $item->attr_title, 'divider' ) == 0 && $depth === 1 ) {
$output .= $indent . '<li role="presentation" class="divider">'; $output .= $indent . '<li class="divider" role="presentation">';
} else if ( strcasecmp( $item->title, 'divider') == 0 && $depth === 1 ) { } else if ( strcasecmp( $item->title, 'divider') == 0 && $depth === 1 ) {
$output .= $indent . '<li role="presentation" class="divider">'; $output .= $indent . '<li class="divider" role="presentation">';
} else if ( strcasecmp( $item->attr_title, 'dropdown-header') == 0 && $depth === 1 ) { } else if ( strcasecmp( $item->attr_title, 'dropdown-header') == 0 && $depth === 1 ) {
$output .= $indent . '<li role="presentation" class="dropdown-header">' . esc_attr( $item->title ); $output .= $indent . '<li class="dropdown-header" role="presentation">' . esc_attr( $item->title );
} else if ( strcasecmp($item->attr_title, 'disabled' ) == 0 ) { } else if ( strcasecmp($item->attr_title, 'disabled' ) == 0 ) {
$output .= $indent . '<li role="presentation" class="disabled"><a href="#">' . esc_attr( $item->title ) . '</a>'; $output .= $indent . '<li class="disabled" role="presentation"><a href="#">' . esc_attr( $item->title ) . '</a>';
} else { } else {
$class_names = $value = ''; $class_names = $value = '';
$classes = empty( $item->classes ) ? array() : (array) $item->classes; $classes = empty( $item->classes ) ? array() : (array) $item->classes;
$classes[] = 'nav-item menu-item-' . $item->ID; $classes[] = 'nav-item menu-item-' . $item->ID;
$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) ); $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) );
/* /*
if ( $args->has_children ) if ( $args->has_children )
$class_names .= ' dropdown'; $class_names .= ' dropdown';
*/ */
if($args->has_children && $depth === 0) { $class_names .= ' dropdown'; } elseif($args->has_children && $depth > 0) { $class_names .= ' dropdown-submenu'; } if($args->has_children && $depth === 0) { $class_names .= ' dropdown'; } elseif($args->has_children && $depth > 0) { $class_names .= ' dropdown-submenu'; }
if ( in_array( 'current-menu-item', $classes ) ) if ( in_array( 'current-menu-item', $classes ) )
$class_names .= ' active'; $class_names .= ' active';
// remove Font Awesome icon from classes array and save the icon // remove Font Awesome icon from classes array and save the icon
// we will add the icon back in via a <span> below so it aligns with // we will add the icon back in via a <span> below so it aligns with
// the menu item // the menu item
if ( in_array('fa', $classes)) { if ( in_array('fa', $classes)) {
$key = array_search('fa', $classes); $key = array_search('fa', $classes);
$icon = $classes[$key + 1]; $icon = $classes[$key + 1];
$class_names = str_replace($classes[$key+1], '', $class_names); $class_names = str_replace($classes[$key+1], '', $class_names);
$class_names = str_replace($classes[$key], '', $class_names); $class_names = str_replace($classes[$key], '', $class_names);
} }
$class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : ''; $class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : '';
$id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args ); $id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args );
$id = $id ? ' id="' . esc_attr( $id ) . '"' : ''; $id = $id ? ' id="' . esc_attr( $id ) . '"' : '';
$output .= $indent . '<li' . $id . $value . $class_names .'>'; $output .= $indent . '<li' . $id . $value . $class_names .'>';
$atts = array(); $atts = array();
$atts['title'] = ! empty( $item->title ) ? $item->title : ''; $atts['title'] = ! empty( $item->title ) ? $item->title : '';
$atts['target'] = ! empty( $item->target ) ? $item->target : ''; $atts['target'] = ! empty( $item->target ) ? $item->target : '';
$atts['rel'] = ! empty( $item->xfn ) ? $item->xfn : ''; $atts['rel'] = ! empty( $item->xfn ) ? $item->xfn : '';
// If item has_children add atts to a. // If item has_children add atts to a.
if ( $args->has_children && $depth === 0 ) { if ( $args->has_children && $depth === 0 ) {
$atts['href'] = '#'; $atts['href'] = '#';
$atts['data-toggle'] = 'dropdown'; $atts['data-toggle'] = 'dropdown';
$atts['class'] = 'nav-link dropdown-toggle'; $atts['class'] = 'nav-link dropdown-toggle';
} else { } else {
$atts['href'] = ! empty( $item->url ) ? $item->url : ''; $atts['href'] = ! empty( $item->url ) ? $item->url : '';
$atts['class'] = 'nav-link'; $atts['class'] = 'nav-link';
} }
$atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args ); $atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args );
$attributes = ''; $attributes = '';
foreach ( $atts as $attr => $value ) { foreach ( $atts as $attr => $value ) {
if ( ! empty( $value ) ) { if ( ! empty( $value ) ) {
$value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value ); $value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );
$attributes .= ' ' . $attr . '="' . $value . '"'; $attributes .= ' ' . $attr . '="' . $value . '"';
} }
} }
$item_output = $args->before; $item_output = $args->before;
// Font Awesome icons // Font Awesome icons
if ( ! empty( $icon ) ) if ( ! empty( $icon ) )
$item_output .= '<a'. $attributes .'><span class="fa ' . esc_attr( $icon ) . '"></span>&nbsp;'; $item_output .= '<a'. $attributes .'><span class="fa ' . esc_attr( $icon ) . '"></span>&nbsp;';
else else
$item_output .= '<a'. $attributes .'>'; $item_output .= '<a'. $attributes .'>';
$item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after; $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
$item_output .= ( $args->has_children && 0 === $depth ) ? ' <span class="caret"></span></a>' : '</a>'; $item_output .= ( $args->has_children && 0 === $depth ) ? ' <span class="caret"></span></a>' : '</a>';
$item_output .= $args->after; $item_output .= $args->after;
$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args ); $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
} }
} }
/** /**
* Traverse elements to create list from elements. * Traverse elements to create list from elements.
* *
* Display one element if the element doesn't have any children otherwise, * Display one element if the element doesn't have any children otherwise,
* display the element and its children. Will only traverse up to the max * display the element and its children. Will only traverse up to the max
* depth and no ignore elements under that depth. * depth and no ignore elements under that depth.
* *
* This method shouldn't be called directly, use the walk() method instead. * This method shouldn't be called directly, use the walk() method instead.
* *
* @see Walker::start_el() * @see Walker::start_el()
* @since 2.5.0 * @since 2.5.0
* *
* @param object $element Data object * @param object $element Data object
* @param array $children_elements List of elements to continue traversing. * @param array $children_elements List of elements to continue traversing.
* @param int $max_depth Max depth to traverse. * @param int $max_depth Max depth to traverse.
* @param int $depth Depth of current element. * @param int $depth Depth of current element.
* @param array $args * @param array $args
* @param string $output Passed by reference. Used to append additional content. * @param string $output Passed by reference. Used to append additional content.
* @return null Null on failure with no changes to parameters. * @return null Null on failure with no changes to parameters.
*/ */
public function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) { public function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {
if ( ! $element ) if ( ! $element )
return; return;
$id_field = $this->db_fields['id']; $id_field = $this->db_fields['id'];
@ -146,41 +146,40 @@ class wp_bootstrap_navwalker extends Walker_Nav_Menu {
$args[0]->has_children = ! empty( $children_elements[ $element->$id_field ] ); $args[0]->has_children = ! empty( $children_elements[ $element->$id_field ] );
parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output ); parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
} }
/** /**
* Menu Fallback * Menu Fallback
* ============= * =============
* If this function is assigned to the wp_nav_menu's fallback_cb variable * If this function is assigned to the wp_nav_menu's fallback_cb variable
* and a manu has not been assigned to the theme location in the WordPress * and a manu has not been assigned to the theme location in the WordPress
* menu manager the function with display nothing to a non-logged in user, * menu manager the function with display nothing to a non-logged in user,
* and will add a link to the WordPress menu manager if logged in as an admin. * and will add a link to the WordPress menu manager if logged in as an admin.
* *
* @param array $args passed from the wp_nav_menu function. * @param array $args passed from the wp_nav_menu function.
* *
*/ */
public static function fallback( $args ) { public static function fallback( $args ) {
if ( current_user_can( 'manage_options' ) ) { if ( current_user_can( 'manage_options' ) ) {
extract( $args ); extract( $args );
$fb_output = null; $fb_output = null;
if ( $container ) { if ( $container ) {
$fb_output = '<' . $container; $fb_output = '<' . $container;
if ( $container_id ) if ( $container_class )
$fb_output .= ' id="' . $container_id . '"'; $fb_output .= ' class="' . $container_class . '"';
if ( $container_class ) if ( $container_id )
$fb_output .= ' class="' . $container_class . '"'; $fb_output .= ' id="' . $container_id . '"';
$fb_output .= '>'; $fb_output .= '>';
} }
$fb_output .= '<ul'; $fb_output .= '<ul';
if ( $menu_id ) if ( $menu_class )
$fb_output .= ' id="' . $menu_id . '"'; $fb_output .= ' class="' . $menu_class . '"';
if ( $menu_class ) if ( $menu_id )
$fb_output .= ' class="' . $menu_class . '"'; $fb_output .= ' id="' . $menu_id . '"';
$fb_output .= '>'; $fb_output .= '>';
$fb_output .= '<li><a href="' . admin_url( 'nav-menus.php' ) . '">Add a menu</a></li>'; $fb_output .= '<li><a href="' . admin_url( 'nav-menus.php' ) . '">Add a menu</a></li>';
$fb_output .= '</ul>'; $fb_output .= '</ul>';
if ( $container ) if ( $container )
$fb_output .= '</' . $container . '>'; $fb_output .= '</' . $container . '>';
echo $fb_output; echo $fb_output;
} }
} }
} }

View File

@ -10,11 +10,11 @@
$html5 = current_theme_supports( 'html5', 'comment-form' ) ? 1 : 0; $html5 = current_theme_supports( 'html5', 'comment-form' ) ? 1 : 0;
$fields = array( $fields = array(
'author' => '<div class="form-group comment-form-author">' . '<label for="author">' . __( 'Name', 'understrap' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' . 'author' => '<div class="form-group comment-form-author">' . '<label for="author">' . __( 'Name', 'understrap' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
'<input class="form-control" id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></div>', '<input class="form-control" id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . '></div>',
'email' => '<div class="form-group comment-form-email"><label for="email">' . __( 'Email', 'understrap' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' . 'email' => '<div class="form-group comment-form-email"><label for="email">' . __( 'Email', 'understrap' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
'<input class="form-control" id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></div>', '<input class="form-control" id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . '></div>',
'url' => '<div class="form-group comment-form-url"><label for="url">' . __( 'Website', 'understrap' ) . '</label> ' . 'url' => '<div class="form-group comment-form-url"><label for="url">' . __( 'Website', 'understrap' ) . '</label> ' .
'<input class="form-control" id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></div>', '<input class="form-control" id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30"></div>',
); );
return $fields; return $fields;
} }
@ -23,7 +23,7 @@
function bootstrap3_comment_form( $args ) { function bootstrap3_comment_form( $args ) {
$args['comment_field'] = '<div class="form-group comment-form-comment"> $args['comment_field'] = '<div class="form-group comment-form-comment">
<label for="comment">' . _x( 'Comment', 'noun', 'understrap' ) . ( ' <span class="required">*</span>' ) . '</label> <label for="comment">' . _x( 'Comment', 'noun', 'understrap' ) . ( ' <span class="required">*</span>' ) . '</label>
<textarea class="form-control" id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea> <textarea class="form-control" id="comment" name="comment" aria-required="true" cols="45" rows="8"></textarea>
</div>'; </div>';
$args['class_submit'] = 'btn btn-secondary'; // since WP 4.1 $args['class_submit'] = 'btn btn-secondary'; // since WP 4.1
return $args; return $args;

View File

@ -11,64 +11,61 @@
* @package understrap * @package understrap
*/ */
get_header(); ?> get_header();
<?php if ( is_front_page() && is_home() ) {
if ( is_front_page() && is_home() ) { get_sidebar('hero');
get_sidebar('hero'); get_sidebar('statichero');
} else {
get_sidebar('statichero');
} else {
// Do nothing...or? // Do nothing...or?
} }
?> ?>
<div class="wrapper" id="wrapper-index"> <div class="wrapper" id="wrapper-index">
<div id="content" class="container"> <div class="container" id="content">
<div class="row"> <div class="row">
<div id="primary" class="<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area"> <div class="<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area" id="primary">
<main id="main" class="site-main" role="main"> <main class="site-main" id="main" role="main">
<?php if ( have_posts() ) : ?> <?php if ( have_posts() ) : ?>
<?php /* Start the Loop */ ?> <?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?> <?php while ( have_posts() ) : the_post(); ?>
<?php <?php
/* Include the Post-Format-specific template for the content. /* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file * If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead. * called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/ */
get_template_part( 'loop-templates/content', get_post_format() ); get_template_part( 'loop-templates/content', get_post_format() );
?> ?>
<?php endwhile; ?> <?php endwhile; ?>
<?php the_posts_navigation(); ?> <?php the_posts_navigation(); ?>
<?php else : ?> <?php else : ?>
<?php get_template_part( 'loop-templates/content', 'none' ); ?> <?php get_template_part( 'loop-templates/content', 'none' ); ?>
<?php endif; ?> <?php endif; ?>
</main><!-- #main --> </main><!-- #main -->
</div><!-- #primary --> </div><!-- #primary -->
<?php get_sidebar(); ?> <?php get_sidebar(); ?>
</div><!-- .row --> </div><!-- .row -->
</div><!-- Container end --> </div><!-- Container end -->
</div><!-- Wrapper end --> </div><!-- Wrapper end -->
<?php get_footer(); ?> <?php get_footer(); ?>

View File

@ -6,5 +6,4 @@
*/ */
?> ?>
<?php the_content(); ?> <?php the_content(); ?>

View File

@ -6,5 +6,4 @@
*/ */
?> ?>
<?php the_content(); ?> <?php the_content(); ?>

View File

@ -9,33 +9,33 @@
?> ?>
<article id="post-0" class="post no-results not-found"> <article class="post no-results not-found" id="post-0">
<header class="page-header"> <header class="page-header">
<h2 class="page-title"><?php _e( 'Nothing Found', 'understrap' ); ?></h2> <h2 class="page-title"><?php _e( 'Nothing Found', 'understrap' ); ?></h2>
</header><!-- .page-header --> </header><!-- .page-header -->
<div class="page-content"> <div class="page-content">
<?php if ( is_home() && current_user_can( 'publish_posts' ) ) : ?> <?php if ( is_home() && current_user_can( 'publish_posts' ) ) : ?>
<p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'understrap' ), esc_url( admin_url( 'post-new.php' ) ) ); ?></p> <p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'understrap' ), esc_url( admin_url( 'post-new.php' ) ) ); ?></p>
<?php elseif ( is_search() ) : ?> <?php elseif ( is_search() ) : ?>
<p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'understrap' ); ?></p> <p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'understrap' ); ?></p>
<?php get_search_form(); ?> <?php get_search_form(); ?>
<?php else : ?> <?php else : ?>
<p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'understrap' ); ?></p> <p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'understrap' ); ?></p>
<?php get_search_form(); ?> <?php get_search_form(); ?>
<?php endif; ?> <?php endif; ?>
</div><!-- .page-content --> </div><!-- .page-content -->
</article><!-- .no-results --> </article><!-- .no-results -->

View File

@ -6,33 +6,33 @@
*/ */
?> ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<header class="entry-header"> <header class="entry-header">
<?php the_title( '<h2 class="entry-title">', '</h2>' ); ?> <?php the_title( '<h2 class="entry-title">', '</h2>' ); ?>
</header><!-- .entry-header --> </header><!-- .entry-header -->
<?php echo get_the_post_thumbnail( $post->ID, 'large' ); ?> <?php echo get_the_post_thumbnail( $post->ID, 'large' ); ?>
<div class="entry-content"> <div class="entry-content">
<?php the_content(); ?> <?php the_content(); ?>
<?php <?php
wp_link_pages( array( wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'understrap' ), 'before' => '<div class="page-links">' . __( 'Pages:', 'understrap' ),
'after' => '</div>', 'after' => '</div>',
) ); ) );
?> ?>
</div><!-- .entry-content --> </div><!-- .entry-content -->
<footer class="entry-footer"> <footer class="entry-footer">
<?php edit_post_link( __( 'Edit', 'understrap' ), '<span class="edit-link">', '</span>' ); ?> <?php edit_post_link( __( 'Edit', 'understrap' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-footer --> </footer><!-- .entry-footer -->
</article><!-- #post-## --> </article><!-- #post-## -->

View File

@ -4,34 +4,34 @@
*/ */
?> ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<header class="entry-header"> <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() ) : ?> <?php if ( 'post' == get_post_type() ) : ?>
<div class="entry-meta"> <div class="entry-meta">
<?php understrap_posted_on(); ?> <?php understrap_posted_on(); ?>
</div><!-- .entry-meta --> </div><!-- .entry-meta -->
<?php endif; ?> <?php endif; ?>
</header><!-- .entry-header --> </header><!-- .entry-header -->
<div class="entry-summary"> <div class="entry-summary">
<?php the_excerpt(); ?> <?php the_excerpt(); ?>
</div><!-- .entry-summary --> </div><!-- .entry-summary -->
<footer class="entry-footer"> <footer class="entry-footer">
<?php understrap_entry_footer(); ?> <?php understrap_entry_footer(); ?>
</footer><!-- .entry-footer --> </footer><!-- .entry-footer -->
</article><!-- #post-## --> </article><!-- #post-## -->

View File

@ -4,39 +4,39 @@
*/ */
?> ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<header class="entry-header"> <header class="entry-header">
<?php the_title( '<h2 class="entry-title">', '</h2>' ); ?> <?php the_title( '<h2 class="entry-title">', '</h2>' ); ?>
<div class="entry-meta"> <div class="entry-meta">
<?php understrap_posted_on(); ?> <?php understrap_posted_on(); ?>
</div><!-- .entry-meta --> </div><!-- .entry-meta -->
</header><!-- .entry-header --> </header><!-- .entry-header -->
<?php echo get_the_post_thumbnail( $post->ID, 'large' ); ?> <?php echo get_the_post_thumbnail( $post->ID, 'large' ); ?>
<div class="entry-content"> <div class="entry-content">
<?php the_content(); ?> <?php the_content(); ?>
<?php <?php
wp_link_pages( array( wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'understrap' ), 'before' => '<div class="page-links">' . __( 'Pages:', 'understrap' ),
'after' => '</div>', 'after' => '</div>',
) ); ) );
?> ?>
</div><!-- .entry-content --> </div><!-- .entry-content -->
<footer class="entry-footer"> <footer class="entry-footer">
<?php understrap_entry_footer(); ?> <?php understrap_entry_footer(); ?>
</footer><!-- .entry-footer --> </footer><!-- .entry-footer -->
</article><!-- #post-## --> </article><!-- #post-## -->

View File

@ -8,33 +8,33 @@
<?php global $post ?> <?php global $post ?>
<article id="<?php echo strtolower( $post->post_title ); ?>" <?php post_class(); ?>> <article <?php post_class(); ?> id="<?php echo strtolower( $post->post_title ); ?>">
<header class="entry-header"> <header class="entry-header">
<?php the_title( '<h2 class="entry-title">', '</h2>' ); ?> <?php the_title( '<h2 class="entry-title">', '</h2>' ); ?>
</header><!-- .entry-header --> </header><!-- .entry-header -->
<?php echo get_the_post_thumbnail( $post->ID, 'large' ); ?> <?php echo get_the_post_thumbnail( $post->ID, 'large' ); ?>
<div class="entry-content"> <div class="entry-content">
<?php the_content(); ?> <?php the_content(); ?>
<?php <?php
wp_link_pages( array( wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'understrap' ), 'before' => '<div class="page-links">' . __( 'Pages:', 'understrap' ),
'after' => '</div>', 'after' => '</div>',
) ); ) );
?> ?>
</div><!-- .entry-content --> </div><!-- .entry-content -->
<footer class="entry-footer"> <footer class="entry-footer">
<?php edit_post_link( __( 'Edit', 'understrap' ), '<span class="edit-link">', '</span>' ); ?> <?php edit_post_link( __( 'Edit', 'understrap' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-footer --> </footer><!-- .entry-footer -->
</article><!-- #post-## --> </article><!-- #post-## -->

View File

@ -4,43 +4,43 @@
*/ */
?> ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<header class="entry-header"> <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() ) : ?> <?php if ( 'post' == get_post_type() ) : ?>
<div class="entry-meta"> <div class="entry-meta">
<?php understrap_posted_on(); ?> <?php understrap_posted_on(); ?>
</div><!-- .entry-meta --> </div><!-- .entry-meta -->
<?php endif; ?> <?php endif; ?>
</header><!-- .entry-header --> </header><!-- .entry-header -->
<?php echo get_the_post_thumbnail( $post->ID, 'large' ); ?> <?php echo get_the_post_thumbnail( $post->ID, 'large' ); ?>
<div class="entry-content"> <div class="entry-content">
<?php <?php
the_excerpt(); the_excerpt();
?> ?>
<?php <?php
wp_link_pages( array( wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'understrap' ), 'before' => '<div class="page-links">' . __( 'Pages:', 'understrap' ),
'after' => '</div>', 'after' => '</div>',
) ); ) );
?> ?>
</div><!-- .entry-content --> </div><!-- .entry-content -->
<footer class="entry-footer"> <footer class="entry-footer">
<?php understrap_entry_footer(); ?> <?php understrap_entry_footer(); ?>
</footer><!-- .entry-footer --> </footer><!-- .entry-footer -->
</article><!-- #post-## --> </article><!-- #post-## -->

View File

@ -7,10 +7,9 @@
* @package understrap * @package understrap
*/ */
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html <?php language_attributes(); ?>> <html <?php language_attributes(); ?>>
<head> <head>
<meta charset="<?php bloginfo('charset'); ?>"> <meta charset="<?php bloginfo('charset'); ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
@ -20,13 +19,13 @@
<link rel="profile" href="http://gmpg.org/xfn/11"> <link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>"> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>">
<?php wp_head(); ?> <?php wp_head(); ?>
</head> </head>
<body> <body>
<?php while (have_posts()) : the_post(); ?> <?php while (have_posts()) : the_post(); ?>
<?php get_template_part('loop-templates/content', 'blank'); ?> <?php get_template_part('loop-templates/content', 'blank'); ?>
<?php endwhile; // end of the loop. ?> <?php endwhile; // end of the loop. ?>
<?php wp_footer();?> <?php wp_footer();?>
</body> </body>
</html> </html>

View File

@ -7,12 +7,13 @@
* @package understrap * @package understrap
*/ */
get_header(); ?> get_header();
?>
<?php while ( have_posts() ) : the_post(); ?> <?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'loop-templates/content', 'empty' ); ?> <?php get_template_part( 'loop-templates/content', 'empty' ); ?>
<?php endwhile; // end of the loop. ?> <?php endwhile; // end of the loop. ?>
<?php get_footer(); ?> <?php get_footer(); ?>

View File

@ -7,36 +7,37 @@
* @package understrap * @package understrap
*/ */
get_header(); ?> get_header();
?>
<div class="wrapper" id="full-width-page-wrapper"> <div class="wrapper" id="full-width-page-wrapper">
<div id="content" class="container"> <div class="container" id="content">
<div id="primary" class="col-md-12 content-area"> <div class="col-md-12 content-area" id="primary">
<main id="main" class="site-main" role="main"> <main class="site-main" id="main" role="main">
<?php while ( have_posts() ) : the_post(); ?> <?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'loop-templates/content', 'page' ); ?> <?php get_template_part( 'loop-templates/content', 'page' ); ?>
<?php <?php
// If comments are open or we have at least one comment, load up the comment template // If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || get_comments_number() ) : if ( comments_open() || get_comments_number() ) :
comments_template(); comments_template();
endif; endif;
?> ?>
<?php endwhile; // end of the loop. ?> <?php endwhile; // end of the loop. ?>
</main><!-- #main --> </main><!-- #main -->
</div><!-- #primary --> </div><!-- #primary -->
</div><!-- Container end --> </div><!-- Container end -->
</div><!-- Wrapper end --> </div><!-- Wrapper end -->

View File

@ -7,46 +7,46 @@
* @package understrap * @package understrap
*/ */
get_header(); ?> get_header();
?>
<?php <?php
/* /*
* Exclude the posts page from being shown in this layout. * Exclude the posts page from being shown in this layout.
* Order pages by their order number. * Order pages by their order number.
*/ */
$exclude = get_option( 'page_for_posts' ); $exclude = get_option( 'page_for_posts' );
$args = array( $args = array(
'post_type' => 'page', 'post_type' => 'page',
'post__not_in' => array( $exclude ), 'post__not_in' => array( $exclude ),
'orderby' => 'menu_order', 'orderby' => 'menu_order',
'order' => 'ASC' 'order' => 'ASC'
); );
$qry = new WP_Query( $args );
$qry = new WP_Query( $args );
?> ?>
<div class="wrapper" id="full-width-page-wrapper"> <div class="wrapper" id="full-width-page-wrapper">
<div id="content" class="container"> <div class="container" id="content">
<div id="primary" class="col-md-12 content-area"> <div class="col-md-12 content-area" id="primary">
<main id="main" class="site-main" role="main"> <main class="site-main" id="main" role="main">
<?php if ( have_posts() ): while ( $qry->have_posts() ): $qry->the_post() ?> <?php if ( have_posts() ): while ( $qry->have_posts() ): $qry->the_post() ?>
<div class="page"> <div class="page">
<?php get_template_part( 'loop-templates/content', 'verticalpage' ); ?> <?php get_template_part( 'loop-templates/content', 'verticalpage' ); ?>
</div> </div>
<?php wp_reset_postdata(); //reset custom query?> <?php wp_reset_postdata(); //reset custom query?>
<?php endwhile; endif; ?> <?php endwhile; endif; ?>
</main><!-- #main --> </main><!-- #main -->
</div><!-- #primary --> </div><!-- #primary -->
</div><!-- Container end --> </div><!-- Container end -->
</div><!-- Wrapper end --> </div><!-- Wrapper end -->

View File

@ -10,40 +10,41 @@
* @package understrap * @package understrap
*/ */
get_header(); ?> get_header();
?>
<div class="wrapper" id="page-wrapper"> <div class="wrapper" id="page-wrapper">
<div id="content" class="container"> <div class="container" id="content">
<div class="row"> <div class="row">
<div id="primary" class="<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area"> <div class="<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area" id="primary">
<main id="main" class="site-main" role="main"> <main class="site-main" id="main" role="main">
<?php while ( have_posts() ) : the_post(); ?> <?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'loop-templates/content', 'page' ); ?> <?php get_template_part( 'loop-templates/content', 'page' ); ?>
<?php <?php
// If comments are open or we have at least one comment, load up the comment template // If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || get_comments_number() ) : if ( comments_open() || get_comments_number() ) :
comments_template(); comments_template();
endif; endif;
?> ?>
<?php endwhile; // end of the loop. ?> <?php endwhile; // end of the loop. ?>
</main><!-- #main --> </main><!-- #main -->
</div><!-- #primary --> </div><!-- #primary -->
<?php get_sidebar(); ?> <?php get_sidebar(); ?>
</div><!-- .row --> </div><!-- .row -->
</div><!-- Container end --> </div><!-- Container end -->
</div><!-- Wrapper end --> </div><!-- Wrapper end -->

View File

@ -1,93 +1,76 @@
// Some basic padding for all wrappers // Some basic padding for all wrappers
.wrapper { .wrapper { padding: $grid-gutter-width-base 0; }
padding:$grid-gutter-width-base 0;
}
// Reset hero wrapper padding to 0 // Reset hero wrapper padding to 0
#wrapper-hero { #wrapper-hero { padding: 0px !important; }
padding:0px!important;
}
// Adding basic Wordpress classes to pass the Wordpress.org tests // Adding basic Wordpress classes to pass the Wordpress.org tests
.sticky, .gallery-caption, .bypostauthor { .sticky,
font-size:inherit; .gallery-caption,
} .bypostauthor { font-size: inherit; }
// Separate sticky wrapper from main content // Separate sticky wrapper from main content
.wrapper#wrapper-sticky { .wrapper#wrapper-sticky { border-bottom: 1px solid $gray-light; }
border-bottom:1px solid $gray-light;
}
// Adding some contrast background color to footer full widget // Adding some contrast background color to footer full widget
#wrapper-footer-full, #wrapper-static-hero{ #wrapper-footer-full,
background-color: $gray-lighter; #wrapper-static-hero { background-color: $gray-lighter; }
}
// Necessary WP classes // Necessary WP classes
.wp-caption { .wp-caption { font-size: inherit; }
font-size: inherit;
}
.wp-caption-text { .wp-caption-text { font-size: inherit; }
font-size: inherit;
}
.screen-reader-text { .screen-reader-text { font-size: inherit; }
font-size: inherit;
}
.alignright { .alignright {
float: right; float: right;
padding-left:10px; padding-left: 10px;
} }
.alignleft { .alignleft {
float: left; float: left;
padding-right:10px; padding-right: 10px;
} }
.aligncenter { .aligncenter { margin: 0px auto; }
margin:0px auto;
}
//Post design // Post design
.entry-footer span { .entry-footer span { padding-right: 10px; }
padding-right:10px;
}
//Limit featured image size to 100% // Limit featured image size to 100%
img.wp-post-image, article img, figure, img, #secondary img { img.wp-post-image,
max-width: 100%; article img,
figure,
img,
#secondary img {
max-width: 100%;
height: auto; height: auto;
} }
// Skip to content link // Skip to content link
a.skip-link{ a.skip-link {
z-index: 1000; position: fixed;
position: fixed; z-index: 1000;
top: 0px; top: 0px;
right: 0px; right: 0px;
} }
// Reset Jumbotron default margin // Reset Jumbotron default margin
.jumbotron { .jumbotron { margin-bottom: 0px; }
margin-bottom:0px;
// Bootstrap3 to Bootstrap4 "translation"
.menu-item {
float: left;
display: inline;
width: auto;
} }
//Bootstrap3 to Bootstrap4 "translation" /* Navbar toggle
.menu-item {float:left; width:auto; display:inline;} * Custom button for toggling the `.navbar-collapse`, powered by the collapse
//ul.nav.navbar-nav a { * JavaScript plugin.
// display: block; * Navbar vertical align
// padding-top: .425rem; */
// padding-bottom: .425rem;
//}
// Navbar toggle
//
// Custom button for toggling the `.navbar-collapse`, powered by the collapse
// JavaScript plugin.
// Navbar vertical align
.navbar-toggle { .navbar-toggle {
position: relative; position: relative;
float: right; float: right;
@ -97,12 +80,10 @@ right: 0px;
background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214 background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214
border: 1px solid transparent; border: 1px solid transparent;
/*
// We remove the `outline` here, but later compensate by attaching `:hover` * We remove the `outline` here, but later compensate by attaching `:hover` styles to `:focus`.
// styles to `:focus`. */
&:focus { &:focus { outline: 0; }
outline: 0;
}
// Bars // Bars
.icon-bar { .icon-bar {
@ -111,76 +92,59 @@ right: 0px;
height: 2px; height: 2px;
border-radius: 1px; border-radius: 1px;
} }
.icon-bar + .icon-bar { .icon-bar + .icon-bar { margin-top: 4px; }
margin-top: 4px;
}
} }
.navbar { .navbar {
.collapsing, .collapse.in { .collapsing,
width:100%; .collapse.in {
float:left; float: left;
width: 100%;
} }
} }
.navbar-dark { .navbar-dark {
.navbar-toggle { .navbar-toggle { border: 1px solid #fff; }
border:1px solid #fff; .icon-bar { border-bottom: 1px solid #fff; }
} .dropdown-menu { background-color: $gray-dark; }
.icon-bar {
border-bottom:1px solid #fff;
}
.dropdown-menu {
background-color: $gray-dark;
}
} }
.navbar #main-menu { .navbar #main-menu { float:left; }
float:left;
}
.navbar-nav { .navbar-nav {
.nav-item { .nav-item { float: left; }
float: left;
}
.nav-link { .nav-link {
display: block; display: block;
padding-top: .425rem; padding-top: .425rem;
padding-bottom: .425rem; padding-bottom: .425rem;
+ .nav-link { + .nav-link { margin-left: 0rem; }
margin-left: 0rem;
}
} }
.nav-item + .nav-item { .nav-item + .nav-item { margin-left: 0rem; }
margin-left: 0rem;
}
} }
.nav-link { .nav-link {
margin-left:.425rem; margin-right: .425rem;
margin-right:.425rem; margin-left: .425rem;
} }
// Fixing BS dropdown in a dropdown // Fixing BS dropdown in a dropdown
.dropdown-menu .dropdown-menu { .dropdown-menu .dropdown-menu {
position:relative; position: relative;
display:block; display: block;
width: 140px;
margin-left: 10px;
border: none; border: none;
box-shadow: none; box-shadow: none;
margin-left:10px;
width:140px;
li { li {
list-style: square;
padding-left: 0px; padding-left: 0px;
list-style: square;
} }
} }
.dropdown-menu .menu-item { .dropdown-menu .menu-item {
width:100%; width: 100%;
a:hover { a:hover { background-color: $brand-primary; }
background-color:$brand-primary; }
}
}

View File

@ -5,56 +5,57 @@
* @package understrap * @package understrap
*/ */
get_header(); ?> get_header();
?>
<div class="wrapper search-wrapper"> <div class="wrapper search-wrapper">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<section id="primary" class="<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area"> <section class="<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area" id="primary">
<main id="main" class="site-main" role="main"> <main class="site-main" id="main" role="main">
<?php if ( have_posts() ) : ?> <?php if ( have_posts() ) : ?>
<header class="page-header"> <header class="page-header">
<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'understrap' ), '<span>' . get_search_query() . '</span>' ); ?></h1> <h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'understrap' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
</header><!-- .page-header --> </header><!-- .page-header -->
<?php /* Start the Loop */ ?> <?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?> <?php while ( have_posts() ) : the_post(); ?>
<?php <?php
/** /**
* Run the loop for the search to output the results. * Run the loop for the search to output the results.
* If you want to overload this in a child theme then include a file * If you want to overload this in a child theme then include a file
* called content-search.php and that will be used instead. * called content-search.php and that will be used instead.
*/ */
get_template_part( 'loop-templates/content', 'search' ); get_template_part( 'loop-templates/content', 'search' );
?> ?>
<?php endwhile; ?> <?php endwhile; ?>
<?php the_posts_navigation(); ?> <?php the_posts_navigation(); ?>
<?php else : ?> <?php else : ?>
<?php get_template_part( 'loop-templates/content', 'none' ); ?> <?php get_template_part( 'loop-templates/content', 'none' ); ?>
<?php endif; ?> <?php endif; ?>
</main><!-- #main --> </main><!-- #main -->
</section><!-- #primary --> </section><!-- #primary -->
<?php get_sidebar(); ?> <?php get_sidebar(); ?>
</div><!-- .row --> </div><!-- .row -->
</div><!-- Container end --> </div><!-- Container end -->
</div><!-- Wrapper end --> </div><!-- Wrapper end -->

View File

@ -5,12 +5,13 @@
* @package understrap * @package understrap
*/ */
?> ?>
<form method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>" role="search">
<label for="s" class="assistive-text"><?php _e( 'Search', 'understrap' ); ?></label> <form method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>" role="search">
<div class="input-group"> <label class="assistive-text" for="s"><?php _e( 'Search', 'understrap' ); ?></label>
<input type="text" class="field form-control" name="s" id="s" placeholder="<?php esc_attr_e( 'Search &hellip;', 'understrap' ); ?>" /> <div class="input-group">
<span class="input-group-btn"> <input class="field form-control" id="s" name="s" type="text" placeholder="<?php esc_attr_e( 'Search &hellip;', 'understrap' ); ?>">
<input type="submit" class="submit btn btn-primary" name="submit" id="searchsubmit" value="<?php esc_attr_e( 'Search', 'understrap' ); ?>" /> <span class="input-group-btn">
</span> <input class="submit btn btn-primary" id="searchsubmit" name="submit" type="submit" value="<?php esc_attr_e( 'Search', 'understrap' ); ?>">
</div> </span>
</form> </div>
</form>

View File

@ -1,11 +1,11 @@
<?php if ( is_active_sidebar( 'footerfull' ) ): ?> <?php if ( is_active_sidebar( 'footerfull' ) ): ?>
<!-- ******************* The Hero Widget Area ******************* --> <!-- ******************* The Hero Widget Area ******************* -->
<div class="wrapper" id="wrapper-footer-full"> <div class="wrapper" id="wrapper-footer-full">
<?php dynamic_sidebar( 'footerfull' ); ?> <?php dynamic_sidebar( 'footerfull' ); ?>
</div><!-- #wrapper-footer-full --> </div><!-- #wrapper-footer-full -->
<?php endif; ?> <?php endif; ?>

View File

@ -1,15 +1,15 @@
<?php if ( is_active_sidebar( 'hero' ) ): ?> <?php if ( is_active_sidebar( 'hero' ) ): ?>
<!-- ******************* The Hero Widget Area ******************* --> <!-- ******************* The Hero Widget Area ******************* -->
<div class="wrapper" id="wrapper-hero"> <div class="wrapper" id="wrapper-hero">
<div class="owl-carousel"> <div class="owl-carousel">
<?php dynamic_sidebar( 'hero' ); ?> <?php dynamic_sidebar( 'hero' ); ?>
</div><!-- .owl-carousel --> </div><!-- .owl-carousel -->
</div><!-- #wrapper-hero --> </div><!-- #wrapper-hero -->
<?php endif; ?> <?php endif; ?>

View File

@ -1,11 +1,11 @@
<?php if ( is_active_sidebar( 'statichero' ) ): ?> <?php if ( is_active_sidebar( 'statichero' ) ): ?>
<!-- ******************* The Hero Widget Area ******************* --> <!-- ******************* The Hero Widget Area ******************* -->
<div class="wrapper" id="wrapper-static-hero"> <div class="wrapper" id="wrapper-static-hero">
<?php dynamic_sidebar( 'statichero' ); ?> <?php dynamic_sidebar( 'statichero' ); ?>
</div><!-- #wrapper-static-hero --> </div><!-- #wrapper-static-hero -->
<?php endif; ?> <?php endif; ?>

View File

@ -6,12 +6,12 @@
*/ */
if ( ! is_active_sidebar( 'sidebar-1' ) ) { if ( ! is_active_sidebar( 'sidebar-1' ) ) {
return; return;
} }
?> ?>
<div id="secondary" class="col-md-4 widget-area" role="complementary"> <div class="col-md-4 widget-area" id="secondary" role="complementary">
<?php dynamic_sidebar( 'sidebar-1' ); ?> <?php dynamic_sidebar( 'sidebar-1' ); ?>
</div><!-- #secondary --> </div><!-- #secondary -->

View File

@ -5,41 +5,42 @@
* @package understrap * @package understrap
*/ */
get_header(); ?> get_header();
?>
<div class="wrapper" id="single-wrapper"> <div class="wrapper" id="single-wrapper">
<div id="content" class="container"> <div class="container" id="content">
<div class="row"> <div class="row">
<div id="primary" class="<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area"> <div class="<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area" id="primary">
<main id="main" class="site-main" role="main"> <main class="site-main" id="main" role="main">
<?php while ( have_posts() ) : the_post(); ?> <?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'loop-templates/content', 'single' ); ?> <?php get_template_part( 'loop-templates/content', 'single' ); ?>
<?php the_post_navigation(); ?> <?php the_post_navigation(); ?>
<?php <?php
// If comments are open or we have at least one comment, load up the comment template // If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || get_comments_number() ) : if ( comments_open() || get_comments_number() ) :
comments_template(); comments_template();
endif; endif;
?> ?>
<?php endwhile; // end of the loop. ?> <?php endwhile; // end of the loop. ?>
</main><!-- #main --> </main><!-- #main -->
</div><!-- #primary --> </div><!-- #primary -->
<?php get_sidebar(); ?> <?php get_sidebar(); ?>
</div><!-- .row --> </div><!-- .row -->
</div><!-- Container end --> </div><!-- Container end -->
</div><!-- Wrapper end --> </div><!-- Wrapper end -->

View File

@ -10,39 +10,40 @@
* @package understrap * @package understrap
*/ */
get_header(); ?> get_header();
?>
<div class="wrapper" id="woocommerce-wrapper"> <div class="wrapper" id="woocommerce-wrapper">
<div class="container"> <div class="container">
<div id="primary" class="<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area"> <div class="<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area" id="primary">
<main id="main" class="site-main" role="main"> <main class="site-main" id="main" role="main">
<!-- The WooCommerce loop --> <!-- The WooCommerce loop -->
<?php <?php
if (is_singular('product')) { if (is_singular('product')) {
woocommerce_content(); woocommerce_content();
} else { } else {
//For ANY product archive. //For ANY product archive.
//Product taxonomy, product search or /shop landing page etc. //Product taxonomy, product search or /shop landing page etc.
woocommerce_get_template('archive-product.php'); woocommerce_get_template('archive-product.php');
} }
?> ?>
</main><!-- #main --> </main><!-- #main -->
</div><!-- #primary --> </div><!-- #primary -->
<?php get_sidebar(); ?> <?php get_sidebar(); ?>
</div><!-- Container end --> </div><!-- Container end -->
</div><!-- Wrapper end --> </div><!-- Wrapper end -->