v1.5.0: extend theme with navigation dropdowns, 9 page templates, auth UI, newsletter, contact panel
Major theme extension adding full-featured navigation with dropdown submenus (Tools, My Data, Resources), 9 new page templates (Calculator, Protocol Builder, Tracker, Subject Log, Documentation, Directory, Science Feed, Profile, Sign In/Register), documentation page with sidebar ToC and scroll spy, branded AJAX authentication forms, newsletter signup with admin export, slide-out contact/support panel, Research Modules 6-card grid on front page, and comprehensive footer update. Split functions.php (554→206 lines) into 6 focused inc/ modules: helpers, customizer, auth-handlers, contact-handler, page-setup, newsletter-admin. All new components include dark mode support, CSRF protection, input sanitization, output escaping, and graceful plugin degradation via shortcode_exists(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
78
footer.php
78
footer.php
@@ -2,46 +2,33 @@
|
||||
/**
|
||||
* The footer for Peptide Starter theme
|
||||
*
|
||||
* Updated footer with disclaimer, language links, and settings panel.
|
||||
*
|
||||
* @see template-parts/settings-panel.php — slide-out support panel
|
||||
* @see template-parts/newsletter-signup.php — newsletter CTA (on front page)
|
||||
* @see functions.php — newsletter handler, contact form handler
|
||||
*
|
||||
* @package peptide-starter
|
||||
*/
|
||||
|
||||
?>
|
||||
</main><!-- #main -->
|
||||
|
||||
<!-- Newsletter Signup (front page only — science feed includes its own) -->
|
||||
<?php if ( is_front_page() ) : ?>
|
||||
<?php get_template_part( 'template-parts/newsletter', 'signup' ); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<footer class="site-footer">
|
||||
<div class="footer-wrapper">
|
||||
<!-- Newsletter Signup -->
|
||||
<?php if ( peptide_starter_show_newsletter_form() ) { ?>
|
||||
<div class="footer-newsletter">
|
||||
<h3><?php esc_html_e( 'Stay Updated', 'peptide-starter' ); ?></h3>
|
||||
<p><?php esc_html_e( 'Subscribe to our newsletter for the latest peptide research and updates.', 'peptide-starter' ); ?></p>
|
||||
<form class="newsletter-form" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" method="post">
|
||||
<?php wp_nonce_field( 'peptide_starter_newsletter', 'ps_newsletter_nonce' ); ?>
|
||||
<input type="hidden" name="action" value="peptide_starter_newsletter_signup">
|
||||
<input
|
||||
type="email"
|
||||
name="email"
|
||||
class="newsletter-input"
|
||||
placeholder="<?php esc_attr_e( 'your@email.com', 'peptide-starter' ); ?>"
|
||||
required
|
||||
>
|
||||
<button type="submit" class="ps-btn ps-btn-primary">
|
||||
<?php esc_html_e( 'Subscribe', 'peptide-starter' ); ?>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<!-- Footer Grid -->
|
||||
<div class="footer-grid">
|
||||
<!-- Footer Widget Areas -->
|
||||
<?php
|
||||
for ( $i = 1; $i <= 4; $i++ ) {
|
||||
echo '<div class="footer-section">';
|
||||
if ( is_active_sidebar( 'footer-' . $i ) ) {
|
||||
dynamic_sidebar( 'footer-' . $i );
|
||||
} else {
|
||||
// Default footer content if no widgets
|
||||
// Default footer content if no widgets.
|
||||
if ( 1 === $i ) {
|
||||
echo '<h3>' . esc_html__( 'About', 'peptide-starter' ) . '</h3>';
|
||||
echo '<p>' . esc_html__( 'Peptide Repo is a comprehensive scientific database for peptide research.', 'peptide-starter' ) . '</p>';
|
||||
@@ -50,18 +37,20 @@
|
||||
echo '<ul>';
|
||||
echo '<li><a href="' . esc_url( home_url( '/' ) ) . '">' . esc_html__( 'Home', 'peptide-starter' ) . '</a></li>';
|
||||
echo '<li><a href="' . esc_url( home_url( '/peptides' ) ) . '">' . esc_html__( 'Peptides Database', 'peptide-starter' ) . '</a></li>';
|
||||
echo '<li><a href="' . esc_url( home_url( '/documentation' ) ) . '">' . esc_html__( 'Documentation', 'peptide-starter' ) . '</a></li>';
|
||||
echo '<li><a href="' . esc_url( home_url( '/news' ) ) . '">' . esc_html__( 'Science Feed', 'peptide-starter' ) . '</a></li>';
|
||||
echo '</ul>';
|
||||
} elseif ( 3 === $i ) {
|
||||
echo '<h3>' . esc_html__( 'Resources', 'peptide-starter' ) . '</h3>';
|
||||
echo '<h3>' . esc_html__( 'Tools', 'peptide-starter' ) . '</h3>';
|
||||
echo '<ul>';
|
||||
echo '<li><a href="#">' . esc_html__( 'Research', 'peptide-starter' ) . '</a></li>';
|
||||
echo '<li><a href="#">' . esc_html__( 'Documentation', 'peptide-starter' ) . '</a></li>';
|
||||
echo '<li><a href="' . esc_url( home_url( '/calculator' ) ) . '">' . esc_html__( 'Calculator', 'peptide-starter' ) . '</a></li>';
|
||||
echo '<li><a href="' . esc_url( home_url( '/protocol-builder' ) ) . '">' . esc_html__( 'Protocol Builder', 'peptide-starter' ) . '</a></li>';
|
||||
echo '<li><a href="' . esc_url( home_url( '/tracker' ) ) . '">' . esc_html__( 'Tracker', 'peptide-starter' ) . '</a></li>';
|
||||
echo '</ul>';
|
||||
} elseif ( 4 === $i ) {
|
||||
echo '<h3>' . esc_html__( 'Connect', 'peptide-starter' ) . '</h3>';
|
||||
echo '<ul>';
|
||||
echo '<li><a href="https://github.com/peptiderepo" target="_blank" rel="noopener">' . esc_html__( 'GitHub', 'peptide-starter' ) . '</a></li>';
|
||||
echo '<li><a href="#">' . esc_html__( 'Twitter', 'peptide-starter' ) . '</a></li>';
|
||||
echo '</ul>';
|
||||
}
|
||||
}
|
||||
@@ -72,11 +61,40 @@
|
||||
|
||||
<!-- Footer Bottom -->
|
||||
<div class="footer-bottom">
|
||||
<p><?php echo wp_kses_post( peptide_starter_get_footer_copyright() ); ?></p>
|
||||
<p class="footer-copyright">
|
||||
<?php
|
||||
echo wp_kses_post(
|
||||
sprintf(
|
||||
/* translators: %s: current year */
|
||||
__( '© %s Research Directory | Laboratory Standards', 'peptide-starter' ),
|
||||
gmdate( 'Y' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
|
||||
<!-- Disclaimer -->
|
||||
<p class="footer-disclaimer">
|
||||
<?php esc_html_e( 'All data is provided for informational and educational purposes only. This platform does not provide medical advice, diagnoses, or treatment recommendations. Always consult qualified professionals.', 'peptide-starter' ); ?>
|
||||
</p>
|
||||
|
||||
<!-- Language Links (placeholder) -->
|
||||
<div class="footer-languages">
|
||||
<span class="footer-languages-label"><?php esc_html_e( 'Our Blogs:', 'peptide-starter' ); ?></span>
|
||||
<a href="#" hreflang="en"><?php esc_html_e( 'English', 'peptide-starter' ); ?></a>
|
||||
<a href="#" hreflang="el"><?php esc_html_e( 'Greek', 'peptide-starter' ); ?></a>
|
||||
<a href="#" hreflang="es"><?php esc_html_e( 'Spanish', 'peptide-starter' ); ?></a>
|
||||
<a href="#" hreflang="nl"><?php esc_html_e( 'Dutch', 'peptide-starter' ); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<?php
|
||||
// Settings slide-out panel (hidden by default, toggled via JS).
|
||||
get_template_part( 'template-parts/settings', 'panel' );
|
||||
?>
|
||||
|
||||
<?php wp_footer(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user