Skip to content

Commit

Permalink
Add sidebar in post list, 404 and search view (#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
albig authored Sep 9, 2024
1 parent 1830337 commit 87192cf
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 22 deletions.
1 change: 1 addition & 0 deletions 404.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@
</div>
</div>
<?php
get_sidebar();
get_footer();
2 changes: 0 additions & 2 deletions category.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@
}
} else {
get_template_part( 'template-parts/content', 'none' );

}

?>

</main><!-- #main -->
Expand Down
24 changes: 13 additions & 11 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div class="row">
<div class="col-12">
<main id="primary" class="site-main archive">
<?php if ( have_posts() ) : ?>
<?php if ( have_posts() ) { ?>

<header class="page-header mb-5 text-center">
<?php
Expand Down Expand Up @@ -77,21 +77,23 @@
'next_text' => __( 'next', 'sunflower' ),
);

printf(
'<div class="d-flex justify-content-around mt-3 mb-5"><div class="sunflower-pagination">%s</div></div>',
wp_kses_post( paginate_links( $sunflower_args ) )
);

else :

get_template_part( 'template-parts/content', 'none' );
$sunflower_paginated_links = paginate_links( $sunflower_args );

endif;
?>
if ( $sunflower_paginated_links ) {
printf(
'<div class="d-flex justify-content-around mt-3 mb-5"><div class="sunflower-pagination">%s</div></div>',
wp_kses_post( $sunflower_paginated_links )
);
}
} else {
get_template_part( 'template-parts/content', 'none' );
}
?>

</main><!-- #main -->
</div>
</div>
</div>
<?php
get_sidebar();
get_footer();
20 changes: 11 additions & 9 deletions search.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<div class="col-12">
<main id="primary" class="site-main archive">

<?php if ( have_posts() ) : ?>
<?php if ( have_posts() ) { ?>

<header class="page-header text-center">
<h1 class="page-title">
Expand Down Expand Up @@ -74,21 +74,23 @@
'next_text' => __( 'next', 'sunflower' ),
);

printf(
'<div class="d-flex justify-content-around mt-3 mb-5"><div class="sunflower-pagination">%s</div></div>',
wp_kses_post( paginate_links( $sunflower_args ) )
);

else :
$sunflower_paginated_links = paginate_links( $sunflower_args );

if ( $sunflower_paginated_links ) {
printf(
'<div class="d-flex justify-content-around mt-3 mb-5"><div class="sunflower-pagination">%s</div></div>',
wp_kses_post( $sunflower_paginated_links )
);
}
} else {
get_template_part( 'template-parts/content', 'none' );

endif;
}
?>

</main><!-- #main -->
</div>
</div>
</div>
<?php
get_sidebar();
get_footer();

0 comments on commit 87192cf

Please sign in to comment.