Skip to content

Commit

Permalink
Continued developing the grid layout variation for search and archives
Browse files Browse the repository at this point in the history
  • Loading branch information
kimcoleman committed Feb 17, 2022
1 parent dbdbaaf commit 348a659
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 9 deletions.
26 changes: 22 additions & 4 deletions archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,35 @@
<?php do_action( 'memberlite_before_loop' ); ?>

<?php if ( have_posts() ) : ?>
<?php
/**
* Wrap posts output in the .grid-list class based on settings.
*/
$content_archives = get_theme_mod( 'content_archives', $memberlite_defaults['content_archives'] );
if ( $content_archives === 'grid' ) { ?>
<div class="grid-list">
<?php }
?>
<?php while ( have_posts() ) :
the_post(); ?>
<?php get_template_part( 'components/post/content', get_post_format() ); ?>
<?php
/**
* Load the grid-style content part based on settings.
*/
if ( $content_archives === 'grid' ) {
get_template_part( 'components/post/content', 'grid' );
} else {
get_template_part( 'components/post/content', get_post_format() );
}
?>
<?php endwhile; ?>

<?php if ( $content_archives === 'grid' ) { ?>
</div> <!-- end .grid-list -->
<?php } ?>
<?php memberlite_paging_nav(); ?>

<?php else : ?>
<?php get_template_part( 'content', 'none' ); ?>
<?php endif; ?>

<?php do_action( 'memberlite_after_loop' ); ?>
</main><!-- #main -->
<?php do_action( 'memberlite_after_main' ); ?>
Expand Down
2 changes: 1 addition & 1 deletion components/post/entry-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
?>

<header class="entry-header">
<?php if ( 'post' == get_post_type() ) : ?>
<?php if ( 'post' == get_post_type() && ! is_search() ) : ?>
<?php
$memberlite_avatar_size = apply_filters( 'memberlite_avatar_size', 80 );
?>
Expand Down
23 changes: 22 additions & 1 deletion search.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,31 @@
<main id="main" class="site-main" role="main">
<?php do_action( 'memberlite_before_loop' ); ?>
<?php if ( have_posts() ) : ?>
<?php
/**
* Wrap posts output in the .grid-list class based on settings.
*/
$content_archives = get_theme_mod( 'content_archives', $memberlite_defaults['content_archives'] );
if ( $content_archives === 'grid' ) { ?>
<div class="grid-list">
<?php }
?>
<?php while ( have_posts() ) :
the_post(); ?>
<?php get_template_part( 'components/post/content', get_post_format() ); ?>
<?php
/**
* Load the grid-style content part based on settings.
*/
if ( $content_archives === 'grid' ) {
get_template_part( 'components/post/content', 'grid' );
} else {
get_template_part( 'components/post/content', get_post_format() );
}
?>
<?php endwhile; ?>
<?php if ( $content_archives === 'grid' ) { ?>
</div> <!-- end .grid-list -->
<?php } ?>
<?php memberlite_paging_nav(); ?>
<?php else : ?>
<?php get_template_part( 'components/post/content', 'none' ); ?>
Expand Down
10 changes: 7 additions & 3 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1478,6 +1478,10 @@ a:active {
min-height: initial;
padding: 5.8rem 0 2.9rem 0;
}
.wp-block-cover-image a:not(.has-text-color),
.wp-block-cover a:not(.has-text-color) {
color: inherit;
}
.text-center {
text-align: center;
}
Expand Down Expand Up @@ -2276,7 +2280,7 @@ a:active {
justify-content: flex-start;
margin-bottom: 2rem;
}
.grid-list article {
.grid-list > * {
background-color: var(--memberlite-color-white);
border: 1px solid var(--memberlite-color-borders);
display: flex;
Expand Down Expand Up @@ -2351,7 +2355,7 @@ a:active {
.grid-list {
flex-direction: row;
}
.grid-list article {
.grid-list > * {
-webkit-box-flex: 0;
flex-grow: 0;
flex-shrink: 1;
Expand All @@ -2362,7 +2366,7 @@ a:active {
.grid-list {
flex-direction: row;
}
.grid-list article {
.grid-list > * {
-webkit-box-flex: 0;
flex-grow: 0;
flex-shrink: 1;
Expand Down

0 comments on commit 348a659

Please sign in to comment.