Skip to content

Commit 622fb79

Browse files
committed
Add sidebar in post list, 404 and search view
1 parent 6694c39 commit 622fb79

File tree

4 files changed

+25
-22
lines changed

4 files changed

+25
-22
lines changed

404.php

+1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@
3131
</div>
3232
</div>
3333
<?php
34+
get_sidebar();
3435
get_footer();

category.php

-2
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,7 @@
107107
}
108108
} else {
109109
get_template_part( 'template-parts/content', 'none' );
110-
111110
}
112-
113111
?>
114112

115113
</main><!-- #main -->

index.php

+13-11
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<div class="row">
1414
<div class="col-12">
1515
<main id="primary" class="site-main archive">
16-
<?php if ( have_posts() ) : ?>
16+
<?php if ( have_posts() ) { ?>
1717

1818
<header class="page-header mb-5 text-center">
1919
<?php
@@ -77,21 +77,23 @@
7777
'next_text' => __( 'next', 'sunflower' ),
7878
);
7979

80-
printf(
81-
'<div class="d-flex justify-content-around mt-3 mb-5"><div class="sunflower-pagination">%s</div></div>',
82-
wp_kses_post( paginate_links( $sunflower_args ) )
83-
);
84-
85-
else :
86-
87-
get_template_part( 'template-parts/content', 'none' );
80+
$sunflower_paginated_links = paginate_links( $sunflower_args );
8881

89-
endif;
90-
?>
82+
if ( $sunflower_paginated_links ) {
83+
printf(
84+
'<div class="d-flex justify-content-around mt-3 mb-5"><div class="sunflower-pagination">%s</div></div>',
85+
wp_kses_post( $sunflower_paginated_links )
86+
);
87+
}
88+
} else {
89+
get_template_part( 'template-parts/content', 'none' );
90+
}
91+
?>
9192

9293
</main><!-- #main -->
9394
</div>
9495
</div>
9596
</div>
9697
<?php
98+
get_sidebar();
9799
get_footer();

search.php

+11-9
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<div class="col-12">
1515
<main id="primary" class="site-main archive">
1616

17-
<?php if ( have_posts() ) : ?>
17+
<?php if ( have_posts() ) { ?>
1818

1919
<header class="page-header text-center">
2020
<h1 class="page-title">
@@ -74,21 +74,23 @@
7474
'next_text' => __( 'next', 'sunflower' ),
7575
);
7676

77-
printf(
78-
'<div class="d-flex justify-content-around mt-3 mb-5"><div class="sunflower-pagination">%s</div></div>',
79-
wp_kses_post( paginate_links( $sunflower_args ) )
80-
);
81-
82-
else :
77+
$sunflower_paginated_links = paginate_links( $sunflower_args );
8378

79+
if ( $sunflower_paginated_links ) {
80+
printf(
81+
'<div class="d-flex justify-content-around mt-3 mb-5"><div class="sunflower-pagination">%s</div></div>',
82+
wp_kses_post( $sunflower_paginated_links )
83+
);
84+
}
85+
} else {
8486
get_template_part( 'template-parts/content', 'none' );
85-
86-
endif;
87+
}
8788
?>
8889

8990
</main><!-- #main -->
9091
</div>
9192
</div>
9293
</div>
9394
<?php
95+
get_sidebar();
9496
get_footer();

0 commit comments

Comments
 (0)