Files
peptide-starter-theme/archive-peptide.php
peptiderepo 65b9f7a13c fix: resolve PHPCS coding standard violations for CI
- Convert all PHP files from CRLF to LF line endings
- Reformat multi-line function calls per WPCS standard
  (opening paren last on line, closing paren on own line)
- Fix assignment-in-conditional in single-peptide.php
- Change double quotes to single quotes in content-none.php
- Exclude InvalidClassFileName sniff (standard WP functions.php pattern)
- Fix archive-peptide.php opening PHP tag placement

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-12 22:54:51 +07:00

75 lines
1.7 KiB
PHP

<?php
/**
* The template for displaying peptide archives
*
* @package peptide-starter
*/
get_header();
?>
<main id="main" class="site-main">
<!-- Archive Header -->
<header class="archive-header">
<div class="ps-container">
<h1 class="archive-title">
<?php
if ( is_tax( 'peptide-category' ) ) {
esc_html_e( 'Peptide Category', 'peptide-starter' );
echo ': ' . esc_html( single_term_title( '', false ) );
} elseif ( is_post_type_archive( 'peptide' ) ) {
esc_html_e( 'Peptide Database', 'peptide-starter' );
} else {
esc_html_e( 'Peptides', 'peptide-starter' );
}
?>
</h1>
</div>
</header>
<!-- Archive Content -->
<div class="archive-content">
<!-- Search/Filter Bar -->
<?php if ( class_exists( 'WP_Widget_Search' ) ) { ?>
<div class="archive-filters">
<div class="archive-search">
<?php get_search_form(); ?>
</div>
</div>
<?php } ?>
<!-- Peptides Grid -->
<?php
if ( have_posts() ) {
?>
<div class="peptides-grid">
<?php
while ( have_posts() ) {
the_post();
get_template_part( 'template-parts/content', 'peptide' );
}
?>
</div>
<!-- Pagination -->
<?php
peptide_starter_pagination();
} else {
// No peptides found
?>
<div class="archive-empty">
<h2><?php esc_html_e( 'No Peptides Found', 'peptide-starter' ); ?></h2>
<p><?php esc_html_e( 'There are no peptides matching your search. Try a different search term or browse the full database.', 'peptide-starter' ); ?></p>
<a href="<?php echo esc_url( home_url( '/peptides' ) ); ?>" class="ps-btn ps-btn-primary">
<?php esc_html_e( 'View All Peptides', 'peptide-starter' ); ?>
</a>
</div>
<?php
}
?>
</div>
</main>
<?php
get_footer();