Merge pull request #149 from stef-k/code-formatting-page-templates - Thx again @stef-k
code format page templates
This commit is contained in:
commit
d1e2b2ddb8
|
@ -6,26 +6,28 @@
|
||||||
*
|
*
|
||||||
* @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>
|
<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>
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
* @package understrap
|
* @package understrap
|
||||||
*/
|
*/
|
||||||
|
|
||||||
get_header();
|
get_header();
|
||||||
$container = get_theme_mod('understrap_container_type');
|
$container = get_theme_mod( 'understrap_container_type' );
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="wrapper" id="page-wrapper">
|
<div class="wrapper" id="page-wrapper">
|
||||||
|
@ -20,9 +20,11 @@ $container = get_theme_mod('understrap_container_type');
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<?php get_sidebar('left'); ?>
|
<?php get_sidebar( 'left' ); ?>
|
||||||
|
|
||||||
<div class="<?php if ( is_active_sidebar( 'left-sidebar' ) || is_active_sidebar( 'right-sidebar' ) ) : ?>col-md-4<?php else : ?>col-md-12<?php endif; ?> content-area" id="primary">
|
<div
|
||||||
|
class="<?php if ( is_active_sidebar( 'left-sidebar' ) || is_active_sidebar( 'right-sidebar' ) ) : ?>col-md-4<?php else : ?>col-md-12<?php endif; ?> content-area"
|
||||||
|
id="primary">
|
||||||
|
|
||||||
<main class="site-main" id="main" role="main">
|
<main class="site-main" id="main" role="main">
|
||||||
|
|
||||||
|
@ -31,7 +33,7 @@ $container = get_theme_mod('understrap_container_type');
|
||||||
<?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;
|
||||||
|
|
|
@ -2,18 +2,16 @@
|
||||||
/**
|
/**
|
||||||
* Template Name: Empty Page Template
|
* Template Name: Empty Page Template
|
||||||
*
|
*
|
||||||
* Template for displaying a page just with the header and footer area and a "naked" content area in between. Good for landingpages and other types of pages where you want to add a lot of custom markup
|
* Template for displaying a page just with the header and footer area and a "naked" content area in between.
|
||||||
|
* Good for landingpages and other types of pages where you want to add a lot of custom markup.
|
||||||
*
|
*
|
||||||
* @package understrap
|
* @package understrap
|
||||||
*/
|
*/
|
||||||
|
|
||||||
get_header();
|
get_header();
|
||||||
?>
|
|
||||||
|
|
||||||
<?php while ( have_posts() ) : the_post(); ?>
|
while ( have_posts() ) : the_post();
|
||||||
|
get_template_part( 'loop-templates/content', 'empty' );
|
||||||
|
endwhile;
|
||||||
|
|
||||||
<?php get_template_part( 'loop-templates/content', 'empty' ); ?>
|
get_footer();
|
||||||
|
|
||||||
<?php endwhile; // end of the loop. ?>
|
|
||||||
|
|
||||||
<?php get_footer(); ?>
|
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
/**
|
/**
|
||||||
* Template Name: Full Width Page
|
* Template Name: Full Width Page
|
||||||
*
|
*
|
||||||
* Template for displaying a page without sidebar even if a sidebar widget is published
|
* Template for displaying a page without sidebar even if a sidebar widget is published.
|
||||||
*
|
*
|
||||||
* @package understrap
|
* @package understrap
|
||||||
*/
|
*/
|
||||||
|
|
||||||
get_header();
|
get_header();
|
||||||
$container = get_theme_mod('understrap_container_type');
|
$container = get_theme_mod( 'understrap_container_type' );
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="wrapper" id="full-width-page-wrapper">
|
<div class="wrapper" id="full-width-page-wrapper">
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
<?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();
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
* @package understrap
|
* @package understrap
|
||||||
*/
|
*/
|
||||||
|
|
||||||
get_header();
|
get_header();
|
||||||
$container = get_theme_mod('understrap_container_type');
|
$container = get_theme_mod( 'understrap_container_type' );
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="wrapper" id="page-wrapper">
|
<div class="wrapper" id="page-wrapper">
|
||||||
|
@ -17,9 +17,11 @@ $container = get_theme_mod('understrap_container_type');
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<?php get_sidebar('left'); ?>
|
<?php get_sidebar( 'left' ); ?>
|
||||||
|
|
||||||
<div class="<?php if ( is_active_sidebar( 'left-sidebar' ) ) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area" id="primary">
|
<div
|
||||||
|
class="<?php if ( is_active_sidebar( 'left-sidebar' ) ) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area"
|
||||||
|
id="primary">
|
||||||
|
|
||||||
<main class="site-main" id="main" role="main">
|
<main class="site-main" id="main" role="main">
|
||||||
|
|
||||||
|
@ -28,7 +30,7 @@ $container = get_theme_mod('understrap_container_type');
|
||||||
<?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;
|
||||||
|
@ -44,6 +46,6 @@ $container = get_theme_mod('understrap_container_type');
|
||||||
|
|
||||||
</div><!-- Container end -->
|
</div><!-- Container end -->
|
||||||
|
|
||||||
</div><!-- Wrapper end -->
|
</div><!-- Wrapper end -->
|
||||||
|
|
||||||
<?php get_footer(); ?>
|
<?php get_footer(); ?>
|
||||||
|
|
|
@ -12,14 +12,15 @@ $container = get_theme_mod( 'understrap_container_type' );
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?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 = array();
|
$exclude = array();
|
||||||
// exclude blog page
|
// exclude blog page.
|
||||||
array_push($exclude, get_option( 'page_for_posts' ) );
|
array_push( $exclude, get_option( 'page_for_posts' ) );
|
||||||
// exclude WooCommerce pages
|
// exclude WooCommerce pages.
|
||||||
array_push( $exclude, get_option( 'woocommerce_cart_page_id' ) );
|
array_push( $exclude, get_option( 'woocommerce_cart_page_id' ) );
|
||||||
array_push( $exclude, get_option( 'woocommerce_shop_page_id' ) );
|
array_push( $exclude, get_option( 'woocommerce_shop_page_id' ) );
|
||||||
array_push( $exclude, get_option( 'woocommerce_checkout_page_id' ) );
|
array_push( $exclude, get_option( 'woocommerce_checkout_page_id' ) );
|
||||||
|
@ -33,7 +34,7 @@ $args = array(
|
||||||
'post_type' => 'page',
|
'post_type' => 'page',
|
||||||
'post__not_in' => $exclude,
|
'post__not_in' => $exclude,
|
||||||
'orderby' => 'menu_order',
|
'orderby' => 'menu_order',
|
||||||
'order' => 'ASC'
|
'order' => 'ASC',
|
||||||
);
|
);
|
||||||
|
|
||||||
$qry = new WP_Query( $args );
|
$qry = new WP_Query( $args );
|
||||||
|
@ -47,13 +48,16 @@ $qry = new WP_Query( $args );
|
||||||
|
|
||||||
<main class="site-main" id="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 -->
|
||||||
|
|
||||||
|
|
Reference in New Issue