Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sidebar in post list, 404 and search view #726

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();