wp-rdnyc/index.php

64 lines
1.9 KiB
PHP
Raw Normal View History

<?php
/**
* The default archive page template.
*
* @author Recovery Dharma NYC
* @since 1.0.0
*/
namespace WP_RDNYC;
get_header(); ?>
2021-08-04 07:46:55 -04:00
<main class="container-lg d-flex justify-content-center mt-0 mt-md-3 mb-3">
<div class="content w-100">
2021-07-28 16:39:40 -04:00
<?php
2021-07-28 22:51:24 -04:00
// grab search query if there is one
$search_query_str = is_search() ? esc_html( get_search_query() ) : false;
// output super heading if not singular
if (!is_singular()) {
$title = is_archive() ? get_the_archive_title() : single_post_title( '', false );
$title = $search_query_str ? "Search results for: &#8220;$search_query_str&#8221;" : $title;
echo get_page_multi_heading( $title );
}
// begin the "if have_posts" section
2021-07-28 16:39:40 -04:00
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
echo get_template_part( 'content-templates/content', 'article' );
endwhile;
2021-07-28 22:51:24 -04:00
// output listing pagination if not singular
if (!is_singular()) : ?>
<nav class="d-flex justify-content-between" aria-label="Page navigation">
<div class="nav-previous alignleft">
<?php
$txt = inline_svg( 'bsi-chevron-left', array( 'div_class' => 'icon baseline me-2' ) ) . 'Older';
next_posts_link( $txt ); ?>
2021-07-28 22:51:24 -04:00
</div>
<div class="nav-next alignright">
<?php
$txt = 'Newer' . inline_svg( 'bsi-chevron-right', array( 'div_class' => 'icon baseline ms-2' ) );
previous_posts_link( $txt ); ?>
2021-07-28 22:51:24 -04:00
</div>
</nav>
<?php endif;
2021-07-28 16:39:40 -04:00
2021-07-28 22:51:24 -04:00
// if not have_posts, then handle if this is a search page
else :
if ($search_query_str) { echo "Search results for: &#8220;$search_query_str&#8221;"; }
// finally, end the "if have_posts" section
2021-07-28 16:39:40 -04:00
endif;
2021-07-28 22:51:24 -04:00
2021-07-28 16:39:40 -04:00
?>
2021-07-28 22:51:24 -04:00
</div>
</main>
2021-07-28 22:51:24 -04:00
<?php
get_footer('', array('frontpage'=>false));