root files code format

This commit is contained in:
Stef Kariotidis 2016-11-21 20:47:05 +02:00
parent 92f662269c
commit c4e5d495d4
17 changed files with 455 additions and 410 deletions

86
404.php
View File

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

View File

@ -7,12 +7,12 @@
* @package understrap * @package understrap
*/ */
get_header(); get_header();
?> ?>
<?php <?php
$container = get_theme_mod('understrap_container_type'); $container = get_theme_mod( 'understrap_container_type' );
$sidebar_pos = get_theme_mod('understrap_sidebar_position'); $sidebar_pos = get_theme_mod( 'understrap_sidebar_position' );
?> ?>
<?php get_template_part( 'global-templates/variables', 'none' ); ?> <?php get_template_part( 'global-templates/variables', 'none' ); ?>
@ -20,59 +20,61 @@ $sidebar_pos = get_theme_mod('understrap_sidebar_position');
<div class="wrapper" id="archive-wrapper"> <div class="wrapper" id="archive-wrapper">
<div class="<?php echo esc_html( $container ); ?>" id="content" tabindex="-1"> <div class="<?php echo esc_html( $container ); ?>" id="content" tabindex="-1">
<div class="row"> <div class="row">
<!-- Do the left sidebar check --> <!-- Do the left sidebar check -->
<?php get_template_part( 'global-templates/left-sidebar-check', 'none' ); ?> <?php get_template_part( 'global-templates/left-sidebar-check', 'none' ); ?>
<main class="site-main" id="main"> <main class="site-main" id="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.
* 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.
*/
get_template_part( 'loop-templates/content', get_post_format() );
?>
<?php endwhile; ?> /*
* Include the Post-Format-specific template for the content.
* 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.
*/
get_template_part( 'loop-templates/content', get_post_format() );
?>
<?php the_posts_navigation(); ?> <?php endwhile; ?>
<?php else : ?> <?php the_posts_navigation(); ?>
<?php get_template_part( 'loop-templates/content', 'none' ); ?> <?php else : ?>
<?php endif; ?> <?php get_template_part( 'loop-templates/content', 'none' ); ?>
</main><!-- #main --> <?php endif; ?>
</div><!-- #primary --> </main><!-- #main -->
<!-- Do the right sidebar check --> </div><!-- #primary -->
<?php if ( 'right' === $sidebar_pos || 'both' === $sidebar_pos ): ?>
<?php get_sidebar( 'right' ); ?>
<?php endif; ?>
</div> <!-- .row --> <!-- Do the right sidebar check -->
<?php if ( 'right' === $sidebar_pos || 'both' === $sidebar_pos ) : ?>
</div><!-- Container end --> <?php get_sidebar( 'right' ); ?>
<?php endif; ?>
</div> <!-- .row -->
</div><!-- Container end -->
</div><!-- Wrapper end --> </div><!-- Wrapper end -->

View File

@ -6,89 +6,96 @@
* *
* @package understrap * @package understrap
*/ */
get_header();
$container = get_theme_mod('understrap_container_type'); get_header();
$sidebar_pos = get_theme_mod('understrap_sidebar_position'); $container = get_theme_mod( 'understrap_container_type' );
$sidebar_pos = get_theme_mod( 'understrap_sidebar_position' );
?> ?>
<div class="wrapper" id="author-wrapper"> <div class="wrapper" id="author-wrapper">
<div class="<?php echo esc_html( $container ); ?>" id="content" tabindex="-1"> <div class="<?php echo esc_html( $container ); ?>" id="content" tabindex="-1">
<div class="row"> <div class="row">
<!-- Do the left sidebar check --> <!-- Do the left sidebar check -->
<?php get_template_part( 'global-templates/left-sidebar-check', 'none' ); ?> <?php get_template_part( 'global-templates/left-sidebar-check', 'none' ); ?>
<main class="site-main" id="main"> <main class="site-main" id="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 esc_html( $curauth->nickname ); ?></h1> <h1><?php esc_html_e( 'About:', 'understrap' ); ?><?php echo esc_html( $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 esc_html( $curauth->user_url ); ?>"><?php echo esc_html( $curauth->user_url ); ?></a></dd> <dd>
<?php endif; ?> <a href="<?php echo esc_html( $curauth->user_url ); ?>"><?php echo esc_html( $curauth->user_url ); ?></a>
</dd>
<?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 esc_html( $curauth->user_description ); ?></dd> <dd><?php echo esc_html( $curauth->user_description ); ?></dd>
<?php endif; ?> <?php endif; ?>
</dl> </dl>
<h2><?php esc_html_e( 'Posts by', 'understrap' ); ?> <?php echo esc_html( $curauth->nickname ); ?>:</h2> <h2><?php esc_html_e( 'Posts by', 'understrap' ); ?> <?php echo esc_html( $curauth->nickname ); ?>
:</h2>
</header><!-- .page-header --> </header><!-- .page-header -->
<ul> <ul>
<!-- The Loop --> <!-- The Loop -->
<?php if ( have_posts() ) : ?> <?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?> <?php while ( have_posts() ) : the_post(); ?>
<li> <li>
<a rel="bookmark" href="<?php the_permalink() ?>" title="Permanent Link: <?php the_title(); ?>"> <a rel="bookmark" href="<?php the_permalink() ?>"
<?php the_title(); ?></a>, title="Permanent Link: <?php the_title(); ?>">
<?php understrap_posted_on(); ?> <?php esc_html_e( 'in', 'understrap' ); ?> <?php the_category('&');?> <?php the_title(); ?></a>,
</li> <?php understrap_posted_on(); ?> <?php esc_html_e( 'in',
<?php endwhile; ?> 'understrap' ); ?> <?php the_category( '&' ); ?>
</li>
<?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 -->
<!-- Do the right sidebar check --> <!-- Do the right sidebar check -->
<?php if ( 'right' === $sidebar_pos || 'both' === $sidebar_pos ): ?> <?php if ( 'right' === $sidebar_pos || 'both' === $sidebar_pos ) : ?>
<?php get_sidebar( 'right' ); ?>
<?php endif; ?>
</div> <!-- .row --> <?php get_sidebar( 'right' ); ?>
</div><!-- Container end --> <?php endif; ?>
</div> <!-- .row -->
</div><!-- Container end -->
</div><!-- Wrapper end --> </div><!-- Wrapper end -->

View File

@ -14,70 +14,71 @@
* return early without loading the comments. * return early without loading the comments.
*/ */
if ( post_password_required() ) { if ( post_password_required() ) {
return; return;
} }
?> ?>
<div class="comments-area" id="comments"> <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;',
number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' ); get_comments_number(), 'comments title', 'understrap' ),
?> 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 class="comment-navigation" id="comment-nav-above"> <nav class="comment-navigation" id="comment-nav-above">
<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',
<?php } if ( get_next_comments_link() ) { ?> 'understrap' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'understrap' ) ); ?></div> <?php }
<?php } ?> if ( get_next_comments_link() ) { ?>
</nav><!-- #comment-nav-above --> <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;',
<?php endif; // check for comment navigation ?> 'understrap' ) ); ?></div>
<?php } ?>
</nav><!-- #comment-nav-above -->
<?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 class="comment-navigation" id="comment-nav-below"> <nav class="comment-navigation" id="comment-nav-below">
<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',
<?php } if ( get_next_comments_link() ) { ?> 'understrap' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'understrap' ) ); ?></div> <?php }
<?php } ?> if ( get_next_comments_link() ) { ?>
</nav><!-- #comment-nav-below --> <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;',
<?php endif; // check for comment navigation ?> 'understrap' ) ); ?></div>
<?php } ?>
</nav><!-- #comment-nav-below -->
<?php endif; // check for comment navigation. ?>
<?php endif; // have_comments() ?> <?php endif; // 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> <p class="no-comments"><?php _e( 'Comments are closed.', 'understrap' ); ?></p>
<?php endif; ?> <?php endif; ?>
<?php <?php comment_form(); // Render comments form. ?>
/* Loads the comment-form.php template
/* get_template_part('comment-form');
*/
?>
<?php comment_form(); ?>
</div><!-- #comments --> </div><!-- #comments -->

View File

@ -8,41 +8,44 @@
*/ */
$the_theme = wp_get_theme(); $the_theme = wp_get_theme();
$container = get_theme_mod('understrap_container_type'); $container = get_theme_mod( 'understrap_container_type' );
?> ?>
<?php get_sidebar('footerfull'); ?> <?php get_sidebar( 'footerfull' ); ?>
<div class="wrapper" id="wrapper-footer"> <div class="wrapper" id="wrapper-footer">
<div class="<?php echo esc_html( $container ); ?>" id="content"> <div class="<?php echo esc_html( $container ); ?>" id="content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<footer class="site-footer" id="colophon" 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/',
<span class="sep"> | </span> 'understrap' ) ); ?>"><?php printf( __( 'Proudly powered by %s', 'understrap' ),
<?php printf( __( 'Theme: %1$s by %2$s.', 'understrap' ), $the_theme->get( 'Name' ), '<a href="http://understrap.com/">understrap.com</a>' ); ?> 'WordPress' ); ?></a>
(<?php printf( __( 'Version: %1$s', 'understrap' ), $the_theme->get( 'Version' ) ); ?>) <span class="sep"> | </span>
</div><!-- .site-info --> <?php printf( __( 'Theme: %1$s by %2$s.', 'understrap' ), $the_theme->get( 'Name' ),
'<a href="http://understrap.com/">understrap.com</a>' ); ?>
(<?php printf( __( 'Version: %1$s', 'understrap' ), $the_theme->get( 'Version' ) ); ?>)
</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

@ -1,6 +1,6 @@
<?php <?php
/** /**
* understrap functions and definitions * Understrap functions and definitions
* *
* @package understrap * @package understrap
*/ */
@ -18,8 +18,8 @@ require get_template_directory() . '/inc/setup.php';
require get_template_directory() . '/inc/widgets.php'; require get_template_directory() . '/inc/widgets.php';
/** /**
* Load functions to secure your WP install. * Load functions to secure your WP install.
*/ */
require get_template_directory() . '/inc/security.php'; require get_template_directory() . '/inc/security.php';
/** /**
@ -53,18 +53,18 @@ require get_template_directory() . '/inc/custom-comments.php';
require get_template_directory() . '/inc/jetpack.php'; require get_template_directory() . '/inc/jetpack.php';
/** /**
* Load custom WordPress nav walker. * Load custom WordPress nav walker.
*/ */
require get_template_directory() . '/inc/bootstrap-wp-navwalker.php'; require get_template_directory() . '/inc/bootstrap-wp-navwalker.php';
/** /**
* Load custom WordPress gallery. * Load custom WordPress gallery.
*/ */
require get_template_directory() . '/inc/bootstrap-wp-gallery.php'; require get_template_directory() . '/inc/bootstrap-wp-gallery.php';
/** /**
* Load WooCommerce functions. * Load WooCommerce functions.
*/ */
require get_template_directory() . '/inc/woocommerce.php'; require get_template_directory() . '/inc/woocommerce.php';
/** /**

View File

@ -6,66 +6,73 @@
* *
* @package understrap * @package understrap
*/ */
$container = get_theme_mod( 'understrap_container_type' );
?> ?>
<?php $container = get_theme_mod('understrap_container_type'); ?>
<!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"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<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"
<link rel="profile" href="http://gmpg.org/xfn/11"> content="<?php bloginfo( 'name' ); ?> - <?php bloginfo( 'description' ); ?>">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> <link rel="profile" href="http://gmpg.org/xfn/11">
<?php wp_head(); ?> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php wp_head(); ?>
</head> </head>
<body <?php body_class(); ?>> <body <?php body_class(); ?>>
<div class="hfeed site" id="page"> <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="<?php echo esc_html( $container ); ?>" id="content"> <div class="<?php echo esc_html( $container ); ?>" id="content">
<div class="navbar-header"> <div class="navbar-header">
<!-- .navbar-toggle is used as the toggle for collapsed navbar content --> <!-- .navbar-toggle is used as the toggle for collapsed navbar content -->
<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"></button> <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"></button>
<!-- Your site title as branding in the menu --> <!-- Your site title as branding in the menu -->
<?php if (!has_custom_logo()) { ?> <?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' ) ); ?>"> <a class="navbar-brand" rel="home" href="<?php echo esc_url( home_url( '/' ) ); ?>"
<?php bloginfo( 'name' ); ?> title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>">
</a> <?php bloginfo( 'name' ); ?>
<?php } else { the_custom_logo(); } ?><!-- end custom logo --> </a>
<?php } else {
the_custom_logo();
} ?><!-- end custom logo -->
</div> </div>
<!-- The WordPress Menu goes here --> <!-- The WordPress Menu goes here -->
<?php wp_nav_menu( <?php wp_nav_menu(
array( array(
'theme_location' => 'primary', 'theme_location' => 'primary',
'container_class' => 'collapse navbar-toggleable-xs exCollapsingNavbar', 'container_class' => 'collapse navbar-toggleable-xs exCollapsingNavbar',
'container_id' => 'exCollapsingNavbar', 'container_id' => 'exCollapsingNavbar',
'menu_class' => 'nav navbar-nav', 'menu_class' => 'nav navbar-nav',
'fallback_cb' => '', 'fallback_cb' => '',
'menu_id' => 'main-menu', 'menu_id' => 'main-menu',
'walker' => new WP_Bootstrap_Navwalker() 'walker' => new WP_Bootstrap_Navwalker(),
) )
); ?> ); ?>
</div> <!-- .container --> </div> <!-- .container -->
</nav><!-- .site-navigation --> </nav><!-- .site-navigation -->
</div><!-- .wrapper-navbar end --> </div><!-- .wrapper-navbar end -->

View File

@ -12,18 +12,15 @@
get_header(); get_header();
$container = get_theme_mod( 'understrap_container_type' );
$sidebar_pos = get_theme_mod( 'understrap_sidebar_position' );
$posts_style = get_theme_mod( 'understrap_posts_index_style' );
$container = get_theme_mod('understrap_container_type'); if ( is_front_page() && is_home() ) {
$sidebar_pos = get_theme_mod('understrap_sidebar_position'); get_sidebar( 'hero' );
$posts_style = get_theme_mod( 'understrap_posts_index_style' );
if ( is_front_page() && is_home() ) { get_sidebar( 'statichero' );
get_sidebar('hero'); }
get_sidebar('statichero');
} else {
// Do nothing...or?
}
?> ?>
<div class="wrapper" id="wrapper-home"> <div class="wrapper" id="wrapper-home">
@ -69,7 +66,7 @@ get_header();
<?php get_template_part( 'loop-templates/content', 'none' ); ?> <?php get_template_part( 'loop-templates/content', 'none' ); ?>
<?php endif; ?> <?php endif; ?>
<?php if ( 'masonry' === $posts_style ) : ?></div><?php endif; ?> <?php if ( 'masonry' === $posts_style ) : ?></div><?php endif; ?>
</main><!-- #main --> </main><!-- #main -->
</div><!-- #primary --> </div><!-- #primary -->

View File

@ -11,69 +11,69 @@
* @package understrap * @package understrap
*/ */
get_header(); get_header();
$container = get_theme_mod('understrap_container_type'); $container = get_theme_mod( 'understrap_container_type' );
$sidebar_pos = get_theme_mod('understrap_sidebar_position'); $sidebar_pos = get_theme_mod( 'understrap_sidebar_position' );
if ( is_front_page() && is_home() ) { if ( is_front_page() && is_home() ) {
get_sidebar('hero'); get_sidebar( 'hero' );
get_sidebar('statichero'); get_sidebar( 'statichero' );
} else { }
// Do nothing...or?
}
?> ?>
<div class="wrapper" id="wrapper-index"> <div class="wrapper" id="wrapper-index">
<div class="<?php echo esc_html( $container ); ?>" id="content" tabindex="-1"> <div class="<?php echo esc_html( $container ); ?>" id="content" tabindex="-1">
<div class="row"> <div class="row">
<!-- Do the left sidebar check and opens the primary div --> <!-- Do the left sidebar check and opens the primary div -->
<?php get_template_part( 'global-templates/left-sidebar-check', 'none' ); ?> <?php get_template_part( 'global-templates/left-sidebar-check', 'none' ); ?>
<main class="site-main" id="main"> <main class="site-main" id="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.
* 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.
*/
get_template_part( 'loop-templates/content', get_post_format() );
?>
<?php endwhile; ?> /*
* Include the Post-Format-specific template for the content.
* 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.
*/
get_template_part( 'loop-templates/content', get_post_format() );
?>
<?php the_posts_navigation(); ?> <?php endwhile; ?>
<?php else : ?> <?php the_posts_navigation(); ?>
<?php get_template_part( 'loop-templates/content', 'none' ); ?> <?php else : ?>
<?php endif; ?> <?php get_template_part( 'loop-templates/content', 'none' ); ?>
</main><!-- #main --> <?php endif; ?>
</div><!-- #primary --> </main><!-- #main -->
<!-- Do the right sidebar check --> </div><!-- #primary -->
<?php if ( 'right' === $sidebar_pos || 'both' === $sidebar_pos ): ?>
<?php get_sidebar( 'right' ); ?>
<?php endif; ?>
</div><!-- .row --> <!-- Do the right sidebar check -->
<?php if ( 'right' === $sidebar_pos || 'both' === $sidebar_pos ) : ?>
</div><!-- Container end --> <?php get_sidebar( 'right' ); ?>
<?php endif; ?>
</div><!-- .row -->
</div><!-- Container end -->
</div><!-- Wrapper end --> </div><!-- Wrapper end -->

View File

@ -11,9 +11,7 @@
*/ */
get_header(); get_header();
?>
<?php
$container = get_theme_mod( 'understrap_container_type' ); $container = get_theme_mod( 'understrap_container_type' );
$sidebar_pos = get_theme_mod( 'understrap_sidebar_position' ); $sidebar_pos = get_theme_mod( 'understrap_sidebar_position' );
// On WooCommerce pages there is no need for sidebars as they leave // On WooCommerce pages there is no need for sidebars as they leave
@ -21,14 +19,15 @@ $sidebar_pos = get_theme_mod( 'understrap_sidebar_position' );
// is active and the current page is a WooCommerce page and we do // is active and the current page is a WooCommerce page and we do
// not render sidebars. // not render sidebars.
$is_woocommerce = false; $is_woocommerce = false;
$this_page_id = get_queried_object_id(); $this_page_id = get_queried_object_id();
if ( class_exists( 'WooCommerce' ) ) { if ( class_exists( 'WooCommerce' ) ) {
if ( is_woocommerce() || is_shop() || get_option( 'woocommerce_shop_page_id' ) === $this_page_id || if ( is_woocommerce() || is_shop() || get_option( 'woocommerce_shop_page_id' ) === $this_page_id ||
get_option( 'woocommerce_cart_page_id' ) == $this_page_id || get_option( 'woocommerce_checkout_page_id' ) == $this_page_id || get_option( 'woocommerce_cart_page_id' ) == $this_page_id || get_option( 'woocommerce_checkout_page_id' ) == $this_page_id ||
get_option( 'woocommerce_pay_page_id' ) == $this_page_id || get_option( 'woocommerce_thanks_page_id' ) === $this_page_id || get_option( 'woocommerce_pay_page_id' ) == $this_page_id || get_option( 'woocommerce_thanks_page_id' ) === $this_page_id ||
get_option( 'woocommerce_myaccount_page_id' ) == $this_page_id || get_option( 'woocommerce_edit_address_page_id' ) == $this_page_id || get_option( 'woocommerce_myaccount_page_id' ) == $this_page_id || get_option( 'woocommerce_edit_address_page_id' ) == $this_page_id ||
get_option( 'woocommerce_view_order_page_id' ) == $this_page_id || get_option( 'woocommerce_terms_page_id' ) == $this_page_id) { get_option( 'woocommerce_view_order_page_id' ) == $this_page_id || get_option( 'woocommerce_terms_page_id' ) == $this_page_id
) {
$is_woocommerce = true; $is_woocommerce = true;
} }
@ -66,8 +65,8 @@ if ( class_exists( 'WooCommerce' ) ) {
<!-- Do the right sidebar check --> <!-- Do the right sidebar check -->
<?php if ( 'right' === $sidebar_pos || 'both' === $sidebar_pos ) : ?> <?php if ( 'right' === $sidebar_pos || 'both' === $sidebar_pos ) : ?>
<?php if ( !$is_woocommerce ) : get_sidebar( 'right' ); ?> <?php if ( ! $is_woocommerce ) : get_sidebar( 'right' ); ?>
<?php endif; ?> <?php endif; ?>
<?php endif; ?> <?php endif; ?>

View File

@ -5,68 +5,68 @@
* @package understrap * @package understrap
*/ */
get_header(); get_header();
?>
<?php $container = get_theme_mod( 'understrap_container_type' );
$container = get_theme_mod('understrap_container_type'); $sidebar_pos = get_theme_mod( 'understrap_sidebar_position' );
$sidebar_pos = get_theme_mod('understrap_sidebar_position');
?> ?>
<div class="wrapper search-wrapper"> <div class="wrapper search-wrapper">
<div class="<?php echo esc_html( $container ); ?>" id="content" tabindex="-1"> <div class="<?php echo esc_html( $container ); ?>" id="content" tabindex="-1">
<div class="row"> <div class="row">
<!-- Do the left sidebar check and opens the primary div --> <!-- Do the left sidebar check and opens the primary div -->
<?php get_template_part( 'global-templates/left-sidebar-check', 'none' ); ?> <?php get_template_part( 'global-templates/left-sidebar-check', 'none' ); ?>
<main class="site-main" id="main"> <main class="site-main" id="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 -->
</div><!-- #primary --> </div><!-- #primary -->
<!-- Do the right sidebar check --> <!-- Do the right sidebar check -->
<?php if ( 'right' === $sidebar_pos || 'both' === $sidebar_pos ): ?> <?php if ( 'right' === $sidebar_pos || 'both' === $sidebar_pos ) : ?>
<?php get_sidebar( 'right' ); ?>
<?php endif; ?>
</div><!-- .row --> <?php get_sidebar( 'right' ); ?>
</div><!-- Container end --> <?php endif; ?>
</div><!-- .row -->
</div><!-- Container end -->
</div><!-- Wrapper end --> </div><!-- Wrapper end -->

View File

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

View File

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

View File

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

View File

@ -1,11 +1,19 @@
<?php if ( is_active_sidebar( 'statichero' ) ): ?> <?php
/**
* Static hero sidebar setup.
*
* @package understrap
*/
<!-- ******************* The Hero Widget Area ******************* --> ?>
<?php if ( is_active_sidebar( 'statichero' ) ) : ?>
<div class="wrapper" id="wrapper-static-hero"> <!-- ******************* The Hero Widget Area ******************* -->
<?php dynamic_sidebar( 'statichero' ); ?> <div class="wrapper" id="wrapper-static-hero">
</div><!-- #wrapper-static-hero --> <?php dynamic_sidebar( 'statichero' ); ?>
</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 class="col-md-4 widget-area" id="secondary" 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,54 +5,51 @@
* @package understrap * @package understrap
*/ */
get_header(); get_header();
?> $container = get_theme_mod( 'understrap_container_type' );
$sidebar_pos = get_theme_mod( 'understrap_sidebar_position' );
<?php
$container = get_theme_mod('understrap_container_type');
$sidebar_pos = get_theme_mod('understrap_sidebar_position');
?> ?>
<div class="wrapper" id="single-wrapper"> <div class="wrapper" id="single-wrapper">
<div class="<?php echo esc_html( $container ); ?>" id="content" tabindex="-1"> <div class="<?php echo esc_html( $container ); ?>" id="content" tabindex="-1">
<div class="row"> <div class="row">
<!-- Do the left sidebar check --> <!-- Do the left sidebar check -->
<?php get_template_part( 'global-templates/left-sidebar-check', 'none' ); ?> <?php get_template_part( 'global-templates/left-sidebar-check', 'none' ); ?>
<main class="site-main" id="main"> <main class="site-main" id="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 -->
<!-- Do the right sidebar check --> <!-- Do the right sidebar check -->
<?php if ( 'right' === $sidebar_pos || 'both' === $sidebar_pos ): ?> <?php if ( 'right' === $sidebar_pos || 'both' === $sidebar_pos ) : ?>
<?php get_sidebar( 'right' ); ?>
<?php endif; ?>
</div><!-- .row --> <?php get_sidebar( 'right' ); ?>
</div><!-- Container end --> <?php endif; ?>
</div><!-- .row -->
</div><!-- Container end -->
</div><!-- Wrapper end --> </div><!-- Wrapper end -->