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

10
404.php
View File

@ -1,6 +1,7 @@
<?php
/**
* The template for displaying 404 pages (not found).
*
* @package understrap
*/
@ -20,13 +21,15 @@
<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">
<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(); ?>
@ -56,7 +59,8 @@
<?php
/* 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',
'understrap' ), convert_smilies( ':)' ) ) . '</p>';
the_widget( 'WP_Widget_Archives', 'dropdown=1', "after_title=</h2>$archive_content" );
?>

View File

@ -42,7 +42,9 @@ $sidebar_pos = get_theme_mod('understrap_sidebar_position');
<?php while ( have_posts() ) : the_post(); ?>
<?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
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/

View File

@ -6,6 +6,7 @@
*
* @package understrap
*/
get_header();
$container = get_theme_mod( 'understrap_container_type' );
$sidebar_pos = get_theme_mod( 'understrap_sidebar_position' );
@ -26,7 +27,8 @@
<header class="page-header author-header">
<?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>
@ -38,7 +40,9 @@
<dl>
<?php if ( ! empty( $curauth->user_url ) ) : ?>
<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>
<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 ) ) : ?>
@ -47,7 +51,8 @@
<?php endif; ?>
</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 -->
@ -57,9 +62,11 @@
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<li>
<a rel="bookmark" href="<?php the_permalink() ?>" title="Permanent Link: <?php the_title(); ?>">
<a rel="bookmark" href="<?php the_permalink() ?>"
title="Permanent Link: <?php the_title(); ?>">
<?php the_title(); ?></a>,
<?php understrap_posted_on(); ?> <?php esc_html_e( 'in', 'understrap' ); ?> <?php the_category('&');?>
<?php understrap_posted_on(); ?> <?php esc_html_e( 'in',
'understrap' ); ?> <?php the_category( '&' ); ?>
</li>
<?php endwhile; ?>

View File

@ -25,21 +25,25 @@ if ( post_password_required() ) {
<?php if ( have_comments() ) : ?>
<h2 class="comments-title">
<?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>' );
?>
</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">
<h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'understrap' ); ?></h1>
<?php if ( get_previous_comments_link() ) { ?>
<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'understrap' ) ); ?></div>
<?php } if ( get_next_comments_link() ) { ?>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'understrap' ) ); ?></div>
<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments',
'understrap' ) ); ?></div>
<?php }
if ( get_next_comments_link() ) { ?>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;',
'understrap' ) ); ?></div>
<?php } ?>
</nav><!-- #comment-nav-above -->
<?php endif; // check for comment navigation ?>
<?php endif; // check for comment navigation. ?>
<ol class="comment-list">
<?php
@ -50,18 +54,21 @@ if ( post_password_required() ) {
?>
</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">
<h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'understrap' ); ?></h1>
<?php if ( get_previous_comments_link() ) { ?>
<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'understrap' ) );?></div>
<?php } if ( get_next_comments_link() ) { ?>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'understrap' ) ); ?></div>
<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments',
'understrap' ) ); ?></div>
<?php }
if ( get_next_comments_link() ) { ?>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;',
'understrap' ) ); ?></div>
<?php } ?>
</nav><!-- #comment-nav-below -->
<?php endif; // check for comment navigation ?>
<?php endif; // check for comment navigation. ?>
<?php endif; // have_comments() ?>
<?php endif; // endif have_comments(). ?>
<?php
// If comments are closed and there are comments, let's leave a little note, shall we?
@ -72,12 +79,6 @@ if ( post_password_required() ) {
<?php endif; ?>
<?php
/* Loads the comment-form.php template
/* get_template_part('comment-form');
*/
?>
<?php comment_form(); ?>
<?php comment_form(); // Render comments form. ?>
</div><!-- #comments -->

View File

@ -24,9 +24,12 @@ $container = get_theme_mod('understrap_container_type');
<footer class="site-footer" id="colophon" role="contentinfo">
<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>
<?php printf( __( 'Theme: %1$s by %2$s.', 'understrap' ), $the_theme->get( 'Name' ), '<a href="http://understrap.com/">understrap.com</a>' ); ?>
<?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 -->

View File

@ -1,6 +1,6 @@
<?php
/**
* understrap functions and definitions
* Understrap functions and definitions
*
* @package understrap
*/

View File

@ -6,10 +6,9 @@
*
* @package understrap
*/
$container = get_theme_mod( 'understrap_container_type' );
?>
<?php $container = get_theme_mod('understrap_container_type'); ?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
@ -18,7 +17,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="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="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php wp_head(); ?>
@ -31,23 +31,30 @@
<!-- ******************* The Navbar Area ******************* -->
<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="navbar-header">
<!-- .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 -->
<?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( '/' ) ); ?>"
title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>">
<?php bloginfo( 'name' ); ?>
</a>
<?php } else { the_custom_logo(); } ?><!-- end custom logo -->
<?php } else {
the_custom_logo();
} ?><!-- end custom logo -->
</div>
@ -60,7 +67,7 @@
'menu_class' => 'nav navbar-nav',
'fallback_cb' => '',
'menu_id' => 'main-menu',
'walker' => new WP_Bootstrap_Navwalker()
'walker' => new WP_Bootstrap_Navwalker(),
)
); ?>

View File

@ -12,7 +12,6 @@
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' );
@ -21,8 +20,6 @@ get_header();
get_sidebar( 'hero' );
get_sidebar( 'statichero' );
} else {
// Do nothing...or?
}
?>

View File

@ -20,8 +20,6 @@
get_sidebar( 'hero' );
get_sidebar( 'statichero' );
} else {
// Do nothing...or?
}
?>
@ -43,7 +41,9 @@
<?php while ( have_posts() ) : the_post(); ?>
<?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
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/

View File

@ -11,9 +11,7 @@
*/
get_header();
?>
<?php
$container = get_theme_mod( 'understrap_container_type' );
$sidebar_pos = get_theme_mod( 'understrap_sidebar_position' );
// On WooCommerce pages there is no need for sidebars as they leave
@ -28,7 +26,8 @@ if ( class_exists( 'WooCommerce' ) ) {
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_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;
}

View File

@ -6,8 +6,7 @@
*/
get_header();
?>
<?php
$container = get_theme_mod( 'understrap_container_type' );
$sidebar_pos = get_theme_mod( 'understrap_sidebar_position' );
?>
@ -27,7 +26,8 @@ $sidebar_pos = get_theme_mod('understrap_sidebar_position');
<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 -->

View File

@ -4,14 +4,16 @@
*
* @package understrap
*/
?>
?>
<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>
<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"
placeholder="<?php esc_attr_e( 'Search &hellip;', 'understrap' ); ?>">
<span class="input-group-btn">
<input class="submit btn btn-primary" id="searchsubmit" name="submit" type="submit" value="<?php esc_attr_e( 'Search', 'understrap' ); ?>">
<input class="submit btn btn-primary" id="searchsubmit" name="submit" type="submit"
value="<?php esc_attr_e( 'Search', 'understrap' ); ?>">
</span>
</div>
</form>

View File

@ -1,3 +1,12 @@
<?php
/**
* Sidebar setup for footer full.
*
* @package understrap
*/
?>
<?php if ( is_active_sidebar( 'footerfull' ) ) : ?>
<!-- ******************* The Hero Widget Area ******************* -->

View File

@ -1,3 +1,12 @@
<?php
/**
* Sidebar - hero setup.
*
* @package understrap
*/
?>
<?php if ( is_active_sidebar( 'hero' ) ) : ?>
<!-- ******************* The Hero Widget Area ******************* -->

View File

@ -1,3 +1,11 @@
<?php
/**
* Static hero sidebar setup.
*
* @package understrap
*/
?>
<?php if ( is_active_sidebar( 'statichero' ) ) : ?>
<!-- ******************* The Hero Widget Area ******************* -->

View File

@ -6,9 +6,6 @@
*/
get_header();
?>
<?php
$container = get_theme_mod( 'understrap_container_type' );
$sidebar_pos = get_theme_mod( 'understrap_sidebar_position' );
?>
@ -31,7 +28,7 @@ $sidebar_pos = get_theme_mod('understrap_sidebar_position');
<?php the_post_navigation(); ?>
<?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() ) :
comments_template();
endif;