mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-02 01:01:18 +03:00
Move layout-related code to separate component files
This commit is contained in:
parent
3ebc219416
commit
b08effbe8b
|
@ -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();
|
||||||
|
|
|
@ -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";
|
||||||
|
|
|
@ -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;
|
||||||
|
|
14
themes/wporg-5ftf/css/components/_site-content.scss
Normal file
14
themes/wporg-5ftf/css/components/_site-content.scss
Normal 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 } );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
15
themes/wporg-5ftf/css/components/_site-title.scss
Normal file
15
themes/wporg-5ftf/css/components/_site-title.scss
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
.site-title {
|
||||||
|
|
||||||
|
body:not(.home) & {
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #fff;
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
|
&:hover,
|
||||||
|
&:active {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue