Move layout-related code to separate component files

This commit is contained in:
Kelly Dwan 2019-10-07 17:11:35 -04:00
parent 3ebc219416
commit b08effbe8b
No known key found for this signature in database
GPG key ID: 8BA5575F3D11575D
5 changed files with 55 additions and 41 deletions

View file

@ -10,43 +10,41 @@ if ( ! have_posts() ) {
get_header(); ?> get_header(); ?>
<div id="primary" class="content-area"> <main id="main" class="site-main" role="main">
<main id="main" class="site-main" role="main">
<?php if ( have_posts() ) : ?> <?php if ( have_posts() ) : ?>
<header class="page-header">
<?php
the_archive_title( '<h1 class="page-title">', '</h1>' );
the_archive_description( '<div class="taxonomy-description">', '</div>' );
?>
</header><!-- .page-header -->
<header class="page-header">
<?php <?php
the_archive_title( '<h1 class="page-title">', '</h1>' );
the_archive_description( '<div class="taxonomy-description">', '</div>' );
?>
</header><!-- .page-header -->
while ( have_posts() ) : <?php
the_post();
/* while ( have_posts() ) :
* Include the Post-Format-specific template for the content. the_post();
* 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( 'template-parts/content', 'page' );
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( 'template-parts/content', 'page' );
the_posts_pagination(); endwhile;
else : the_posts_pagination();
get_template_part( 'template-parts/content', 'none' ); else :
endif; get_template_part( 'template-parts/content', 'none' );
?>
</main><!-- #main --> endif;
</div><!-- #primary --> ?>
</main><!-- #main -->
<?php <?php
get_footer(); get_footer();

View file

@ -22,4 +22,6 @@
@import "about"; @import "about";
@import "entry-content"; @import "entry-content";
@import "page"; @import "page";
@import "site-content";
@import "site-title";
@import "wporg-header"; @import "wporg-header";

View file

@ -1,19 +1,4 @@
body.page:not(.home) { body.page:not(.home) {
.site-title a {
color: #fff;
text-decoration: none;
&:hover,
&:active {
color: #fff;
}
}
.site-main {
margin: 0 auto;
padding: 0 ms( 2 );
max-width: calc( #{ $size__content-width } + #{ ms( 2 ) * 2 } );
}
.entry-header { .entry-header {
background: none; background: none;

View file

@ -0,0 +1,14 @@
.site-content {
body:not(.home) & {
margin: auto;
max-width: none;
padding: 0;
.site-main {
margin: 0 auto;
padding: 0 ms( 2 );
max-width: calc( #{ $size__content-width } + #{ ms( 2 ) * 2 } );
}
}
}

View file

@ -0,0 +1,15 @@
.site-title {
body:not(.home) & {
a {
color: #fff;
text-decoration: none;
&:hover,
&:active {
color: #fff;
}
}
}
}