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>
This commit is contained in:
@@ -26,4 +26,9 @@
|
||||
<rule ref="Generic.Arrays.DisallowShortArraySyntax">
|
||||
<exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
|
||||
</rule>
|
||||
|
||||
<!-- Standard WordPress practice: Walker class lives in functions.php -->
|
||||
<rule ref="WordPress.Files.FileName">
|
||||
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
|
||||
</rule>
|
||||
</ruleset>
|
||||
|
||||
72
404.php
72
404.php
@@ -1,36 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* The 404 template
|
||||
*
|
||||
* @package peptide-starter
|
||||
*/
|
||||
|
||||
get_header();
|
||||
?>
|
||||
|
||||
<main id="main" class="site-main">
|
||||
<div class="ps-container">
|
||||
<div class="error-404 not-found">
|
||||
<h1><?php esc_html_e( '404 - Page Not Found', 'peptide-starter' ); ?></h1>
|
||||
<p><?php esc_html_e( "Sorry, the page you're looking for doesn't exist. It might have been moved or deleted.", 'peptide-starter' ); ?></p>
|
||||
|
||||
<form role="search" method="get" class="search-form ps-404-search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
|
||||
<label>
|
||||
<span class="screen-reader-text"><?php esc_html_e( 'Search for:', 'peptide-starter' ); ?></span>
|
||||
<input type="search" class="search-submit" placeholder="<?php esc_attr_e( 'Search peptides...', 'peptide-starter' ); ?>" value="<?php echo esc_attr( get_search_query() ); ?>" name="s" title="<?php esc_attr_e( 'Search for:', 'peptide-starter' ); ?>" />
|
||||
</label>
|
||||
</form>
|
||||
|
||||
<div class="ps-404-cta-group">
|
||||
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="ps-btn ps-btn-primary">
|
||||
<?php esc_html_e( 'Back to Home', 'peptide-starter' ); ?>
|
||||
</a>
|
||||
<a href="<?php echo esc_url( home_url( '/peptides' ) ); ?>" class="ps-btn ps-btn-secondary">
|
||||
<?php esc_html_e( 'Browse Peptides', 'peptide-starter' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
<?php
|
||||
/**
|
||||
* The 404 template
|
||||
*
|
||||
* @package peptide-starter
|
||||
*/
|
||||
|
||||
get_header();
|
||||
?>
|
||||
|
||||
<main id="main" class="site-main">
|
||||
<div class="ps-container">
|
||||
<div class="error-404 not-found">
|
||||
<h1><?php esc_html_e( '404 - Page Not Found', 'peptide-starter' ); ?></h1>
|
||||
<p><?php esc_html_e( "Sorry, the page you're looking for doesn't exist. It might have been moved or deleted.", 'peptide-starter' ); ?></p>
|
||||
|
||||
<form role="search" method="get" class="search-form ps-404-search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
|
||||
<label>
|
||||
<span class="screen-reader-text"><?php esc_html_e( 'Search for:', 'peptide-starter' ); ?></span>
|
||||
<input type="search" class="search-submit" placeholder="<?php esc_attr_e( 'Search peptides...', 'peptide-starter' ); ?>" value="<?php echo esc_attr( get_search_query() ); ?>" name="s" title="<?php esc_attr_e( 'Search for:', 'peptide-starter' ); ?>" />
|
||||
</label>
|
||||
</form>
|
||||
|
||||
<div class="ps-404-cta-group">
|
||||
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="ps-btn ps-btn-primary">
|
||||
<?php esc_html_e( 'Back to Home', 'peptide-starter' ); ?>
|
||||
</a>
|
||||
<a href="<?php echo esc_url( home_url( '/peptides' ) ); ?>" class="ps-btn ps-btn-secondary">
|
||||
<?php esc_html_e( 'Browse Peptides', 'peptide-starter' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
|
||||
@@ -70,4 +70,5 @@ get_header();
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php get_footer();
|
||||
<?php
|
||||
get_footer();
|
||||
|
||||
@@ -1,84 +1,84 @@
|
||||
/**
|
||||
* Navigation and Mobile Menu Toggle
|
||||
* Peptide Starter Theme
|
||||
*
|
||||
* Handles:
|
||||
* - Mobile hamburger menu toggle
|
||||
* - Navigation overlay click handling
|
||||
* - Menu state persistence
|
||||
*/
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
const menuToggle = document.querySelector('.menu-toggle');
|
||||
const primaryNav = document.querySelector('.primary-navigation');
|
||||
const navOverlay = document.querySelector('.nav-overlay');
|
||||
|
||||
if (!menuToggle || !primaryNav || !navOverlay) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle mobile menu visibility
|
||||
*/
|
||||
function toggleMenu() {
|
||||
const isActive = primaryNav.classList.contains('active');
|
||||
|
||||
if (isActive) {
|
||||
closeMenu();
|
||||
} else {
|
||||
openMenu();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Open mobile menu
|
||||
*/
|
||||
function openMenu() {
|
||||
primaryNav.classList.add('active');
|
||||
navOverlay.classList.add('active');
|
||||
document.body.style.overflow = 'hidden';
|
||||
menuToggle.setAttribute('aria-expanded', 'true');
|
||||
}
|
||||
|
||||
/**
|
||||
* Close mobile menu
|
||||
*/
|
||||
function closeMenu() {
|
||||
primaryNav.classList.remove('active');
|
||||
navOverlay.classList.remove('active');
|
||||
document.body.style.overflow = '';
|
||||
menuToggle.setAttribute('aria-expanded', 'false');
|
||||
}
|
||||
|
||||
// Menu toggle button click
|
||||
menuToggle.addEventListener('click', toggleMenu);
|
||||
|
||||
// Overlay click
|
||||
navOverlay.addEventListener('click', closeMenu);
|
||||
|
||||
// Close menu when a nav link is clicked
|
||||
const navLinks = primaryNav.querySelectorAll('a');
|
||||
navLinks.forEach(link => {
|
||||
link.addEventListener('click', closeMenu);
|
||||
});
|
||||
|
||||
// Close menu on Escape key
|
||||
document.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Escape') {
|
||||
closeMenu();
|
||||
}
|
||||
});
|
||||
|
||||
// Set initial aria-expanded state
|
||||
menuToggle.setAttribute('aria-expanded', 'false');
|
||||
|
||||
// Close menu when window is resized above mobile breakpoint
|
||||
const mediaQuery = window.matchMedia('(min-width: 768px)');
|
||||
mediaQuery.addEventListener('change', (e) => {
|
||||
if (e.matches) {
|
||||
closeMenu();
|
||||
}
|
||||
});
|
||||
})();
|
||||
/**
|
||||
* Navigation and Mobile Menu Toggle
|
||||
* Peptide Starter Theme
|
||||
*
|
||||
* Handles:
|
||||
* - Mobile hamburger menu toggle
|
||||
* - Navigation overlay click handling
|
||||
* - Menu state persistence
|
||||
*/
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
const menuToggle = document.querySelector('.menu-toggle');
|
||||
const primaryNav = document.querySelector('.primary-navigation');
|
||||
const navOverlay = document.querySelector('.nav-overlay');
|
||||
|
||||
if (!menuToggle || !primaryNav || !navOverlay) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle mobile menu visibility
|
||||
*/
|
||||
function toggleMenu() {
|
||||
const isActive = primaryNav.classList.contains('active');
|
||||
|
||||
if (isActive) {
|
||||
closeMenu();
|
||||
} else {
|
||||
openMenu();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Open mobile menu
|
||||
*/
|
||||
function openMenu() {
|
||||
primaryNav.classList.add('active');
|
||||
navOverlay.classList.add('active');
|
||||
document.body.style.overflow = 'hidden';
|
||||
menuToggle.setAttribute('aria-expanded', 'true');
|
||||
}
|
||||
|
||||
/**
|
||||
* Close mobile menu
|
||||
*/
|
||||
function closeMenu() {
|
||||
primaryNav.classList.remove('active');
|
||||
navOverlay.classList.remove('active');
|
||||
document.body.style.overflow = '';
|
||||
menuToggle.setAttribute('aria-expanded', 'false');
|
||||
}
|
||||
|
||||
// Menu toggle button click
|
||||
menuToggle.addEventListener('click', toggleMenu);
|
||||
|
||||
// Overlay click
|
||||
navOverlay.addEventListener('click', closeMenu);
|
||||
|
||||
// Close menu when a nav link is clicked
|
||||
const navLinks = primaryNav.querySelectorAll('a');
|
||||
navLinks.forEach(link => {
|
||||
link.addEventListener('click', closeMenu);
|
||||
});
|
||||
|
||||
// Close menu on Escape key
|
||||
document.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Escape') {
|
||||
closeMenu();
|
||||
}
|
||||
});
|
||||
|
||||
// Set initial aria-expanded state
|
||||
menuToggle.setAttribute('aria-expanded', 'false');
|
||||
|
||||
// Close menu when window is resized above mobile breakpoint
|
||||
const mediaQuery = window.matchMedia('(min-width: 768px)');
|
||||
mediaQuery.addEventListener('change', (e) => {
|
||||
if (e.matches) {
|
||||
closeMenu();
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
@@ -1,210 +1,210 @@
|
||||
/**
|
||||
* Theme Utilities
|
||||
* Peptide Starter Theme
|
||||
*
|
||||
* Handles:
|
||||
* - Dark mode toggle functionality
|
||||
* - Dark mode preference persistence
|
||||
* - Plugin dark mode coordination
|
||||
* - Smooth transitions
|
||||
*/
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
const html = document.documentElement;
|
||||
const darkModeToggle = document.querySelector('.dark-mode-toggle');
|
||||
const sunIcon = document.querySelector('.sun-icon');
|
||||
const moonIcon = document.querySelector('.moon-icon');
|
||||
|
||||
if (!darkModeToggle) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current theme preference
|
||||
* @returns {string} 'dark' or 'light'
|
||||
*/
|
||||
function getCurrentTheme() {
|
||||
const stored = localStorage.getItem('peptide-starter-theme');
|
||||
if (stored) {
|
||||
return stored;
|
||||
}
|
||||
|
||||
const currentAttr = html.getAttribute('data-theme');
|
||||
if (currentAttr) {
|
||||
return currentAttr;
|
||||
}
|
||||
|
||||
const systemDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
return systemDark ? 'dark' : 'light';
|
||||
}
|
||||
|
||||
/**
|
||||
* Set theme preference
|
||||
* @param {string} theme - 'dark' or 'light'
|
||||
*/
|
||||
function setTheme(theme) {
|
||||
html.setAttribute('data-theme', theme);
|
||||
localStorage.setItem('peptide-starter-theme', theme);
|
||||
|
||||
// Update icon visibility
|
||||
updateIcons(theme);
|
||||
|
||||
// Notify plugins about theme change via custom event
|
||||
const event = new CustomEvent('themechange', {
|
||||
detail: { theme: theme }
|
||||
});
|
||||
document.dispatchEvent(event);
|
||||
|
||||
// Also update body class for CSS hooks
|
||||
document.body.classList.remove('dark-mode', 'light-mode');
|
||||
document.body.classList.add(theme === 'dark' ? 'dark-mode' : 'light-mode');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update icon visibility based on theme
|
||||
* @param {string} theme - 'dark' or 'light'
|
||||
*/
|
||||
function updateIcons(theme) {
|
||||
if (theme === 'dark') {
|
||||
sunIcon.style.display = 'block';
|
||||
moonIcon.style.display = 'none';
|
||||
} else {
|
||||
sunIcon.style.display = 'none';
|
||||
moonIcon.style.display = 'block';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle between dark and light mode
|
||||
*/
|
||||
function toggleDarkMode() {
|
||||
const currentTheme = getCurrentTheme();
|
||||
const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
|
||||
setTheme(newTheme);
|
||||
}
|
||||
|
||||
// Initialize theme on page load
|
||||
const initialTheme = getCurrentTheme();
|
||||
setTheme(initialTheme);
|
||||
|
||||
// Dark mode toggle button click
|
||||
darkModeToggle.addEventListener('click', toggleDarkMode);
|
||||
|
||||
// Listen for system preference changes
|
||||
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
||||
mediaQuery.addEventListener('change', (e) => {
|
||||
const stored = localStorage.getItem('peptide-starter-theme');
|
||||
if (!stored) {
|
||||
setTheme(e.matches ? 'dark' : 'light');
|
||||
}
|
||||
});
|
||||
|
||||
// Expose API for plugins to read/listen to theme changes
|
||||
window.peptideStarterTheme = {
|
||||
getCurrentTheme: getCurrentTheme,
|
||||
setTheme: setTheme,
|
||||
toggleDarkMode: toggleDarkMode,
|
||||
};
|
||||
|
||||
/**
|
||||
* Plugin Integration Example:
|
||||
* Plugins can listen to theme changes via:
|
||||
*
|
||||
* 1. Custom event listener:
|
||||
* document.addEventListener('themechange', function(e) {
|
||||
* console.log('Theme changed to:', e.detail.theme);
|
||||
* });
|
||||
*
|
||||
* 2. MutationObserver on data-theme:
|
||||
* const observer = new MutationObserver((mutations) => {
|
||||
* const theme = html.getAttribute('data-theme');
|
||||
* console.log('Theme is now:', theme);
|
||||
* });
|
||||
* observer.observe(html, { attributes: true });
|
||||
*
|
||||
* 3. Direct access to CSS custom properties which theme controls
|
||||
*/
|
||||
|
||||
/**
|
||||
* Smooth scroll behavior
|
||||
*/
|
||||
function initSmoothScroll() {
|
||||
const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
||||
if (!prefersReducedMotion) {
|
||||
document.documentElement.style.scrollBehavior = 'smooth';
|
||||
}
|
||||
}
|
||||
|
||||
initSmoothScroll();
|
||||
|
||||
/**
|
||||
* Add focus-visible polyfill for older browsers
|
||||
*/
|
||||
function initFocusVisible() {
|
||||
const isKeyboardEvent = (e) => {
|
||||
return e.mozInputSource === MOZ_SOURCE_KEYBOARD ||
|
||||
e.detail === 0 ||
|
||||
(e.sourceCapabilities && e.sourceCapabilities.firesTouchEvents === false);
|
||||
};
|
||||
|
||||
document.addEventListener('mousedown', (e) => {
|
||||
document.body.classList.remove('keyboard-focus');
|
||||
}, true);
|
||||
|
||||
document.addEventListener('keydown', () => {
|
||||
document.body.classList.add('keyboard-focus');
|
||||
}, true);
|
||||
}
|
||||
|
||||
// Search overlay functionality (Peptide Search AI integration)
|
||||
const searchToggle = document.querySelector('.search-toggle');
|
||||
const searchOverlay = document.getElementById('search-overlay');
|
||||
const searchOverlayClose = document.querySelector('.search-overlay-close');
|
||||
|
||||
function openSearchOverlay() {
|
||||
if (!searchOverlay) return;
|
||||
searchOverlay.classList.add('active');
|
||||
searchOverlay.setAttribute('aria-hidden', 'false');
|
||||
document.body.style.overflow = 'hidden';
|
||||
// Focus the search input inside the overlay
|
||||
const input = searchOverlay.querySelector('.psa-search-input, .ps-search-input, input[type="search"], input[type="text"]');
|
||||
if (input) {
|
||||
setTimeout(() => input.focus(), 100);
|
||||
}
|
||||
}
|
||||
|
||||
function closeSearchOverlay() {
|
||||
if (!searchOverlay) return;
|
||||
searchOverlay.classList.remove('active');
|
||||
searchOverlay.setAttribute('aria-hidden', 'true');
|
||||
document.body.style.overflow = '';
|
||||
// Return focus to search toggle
|
||||
if (searchToggle) searchToggle.focus();
|
||||
}
|
||||
|
||||
if (searchToggle) {
|
||||
searchToggle.addEventListener('click', openSearchOverlay);
|
||||
}
|
||||
|
||||
if (searchOverlayClose) {
|
||||
searchOverlayClose.addEventListener('click', closeSearchOverlay);
|
||||
}
|
||||
|
||||
if (searchOverlay) {
|
||||
// Close overlay when clicking the backdrop
|
||||
searchOverlay.addEventListener('click', (e) => {
|
||||
if (e.target === searchOverlay) {
|
||||
closeSearchOverlay();
|
||||
}
|
||||
});
|
||||
|
||||
// Close on Escape key
|
||||
document.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Escape' && searchOverlay.classList.contains('active')) {
|
||||
closeSearchOverlay();
|
||||
}
|
||||
});
|
||||
}
|
||||
})();
|
||||
/**
|
||||
* Theme Utilities
|
||||
* Peptide Starter Theme
|
||||
*
|
||||
* Handles:
|
||||
* - Dark mode toggle functionality
|
||||
* - Dark mode preference persistence
|
||||
* - Plugin dark mode coordination
|
||||
* - Smooth transitions
|
||||
*/
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
const html = document.documentElement;
|
||||
const darkModeToggle = document.querySelector('.dark-mode-toggle');
|
||||
const sunIcon = document.querySelector('.sun-icon');
|
||||
const moonIcon = document.querySelector('.moon-icon');
|
||||
|
||||
if (!darkModeToggle) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current theme preference
|
||||
* @returns {string} 'dark' or 'light'
|
||||
*/
|
||||
function getCurrentTheme() {
|
||||
const stored = localStorage.getItem('peptide-starter-theme');
|
||||
if (stored) {
|
||||
return stored;
|
||||
}
|
||||
|
||||
const currentAttr = html.getAttribute('data-theme');
|
||||
if (currentAttr) {
|
||||
return currentAttr;
|
||||
}
|
||||
|
||||
const systemDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
return systemDark ? 'dark' : 'light';
|
||||
}
|
||||
|
||||
/**
|
||||
* Set theme preference
|
||||
* @param {string} theme - 'dark' or 'light'
|
||||
*/
|
||||
function setTheme(theme) {
|
||||
html.setAttribute('data-theme', theme);
|
||||
localStorage.setItem('peptide-starter-theme', theme);
|
||||
|
||||
// Update icon visibility
|
||||
updateIcons(theme);
|
||||
|
||||
// Notify plugins about theme change via custom event
|
||||
const event = new CustomEvent('themechange', {
|
||||
detail: { theme: theme }
|
||||
});
|
||||
document.dispatchEvent(event);
|
||||
|
||||
// Also update body class for CSS hooks
|
||||
document.body.classList.remove('dark-mode', 'light-mode');
|
||||
document.body.classList.add(theme === 'dark' ? 'dark-mode' : 'light-mode');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update icon visibility based on theme
|
||||
* @param {string} theme - 'dark' or 'light'
|
||||
*/
|
||||
function updateIcons(theme) {
|
||||
if (theme === 'dark') {
|
||||
sunIcon.style.display = 'block';
|
||||
moonIcon.style.display = 'none';
|
||||
} else {
|
||||
sunIcon.style.display = 'none';
|
||||
moonIcon.style.display = 'block';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle between dark and light mode
|
||||
*/
|
||||
function toggleDarkMode() {
|
||||
const currentTheme = getCurrentTheme();
|
||||
const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
|
||||
setTheme(newTheme);
|
||||
}
|
||||
|
||||
// Initialize theme on page load
|
||||
const initialTheme = getCurrentTheme();
|
||||
setTheme(initialTheme);
|
||||
|
||||
// Dark mode toggle button click
|
||||
darkModeToggle.addEventListener('click', toggleDarkMode);
|
||||
|
||||
// Listen for system preference changes
|
||||
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
||||
mediaQuery.addEventListener('change', (e) => {
|
||||
const stored = localStorage.getItem('peptide-starter-theme');
|
||||
if (!stored) {
|
||||
setTheme(e.matches ? 'dark' : 'light');
|
||||
}
|
||||
});
|
||||
|
||||
// Expose API for plugins to read/listen to theme changes
|
||||
window.peptideStarterTheme = {
|
||||
getCurrentTheme: getCurrentTheme,
|
||||
setTheme: setTheme,
|
||||
toggleDarkMode: toggleDarkMode,
|
||||
};
|
||||
|
||||
/**
|
||||
* Plugin Integration Example:
|
||||
* Plugins can listen to theme changes via:
|
||||
*
|
||||
* 1. Custom event listener:
|
||||
* document.addEventListener('themechange', function(e) {
|
||||
* console.log('Theme changed to:', e.detail.theme);
|
||||
* });
|
||||
*
|
||||
* 2. MutationObserver on data-theme:
|
||||
* const observer = new MutationObserver((mutations) => {
|
||||
* const theme = html.getAttribute('data-theme');
|
||||
* console.log('Theme is now:', theme);
|
||||
* });
|
||||
* observer.observe(html, { attributes: true });
|
||||
*
|
||||
* 3. Direct access to CSS custom properties which theme controls
|
||||
*/
|
||||
|
||||
/**
|
||||
* Smooth scroll behavior
|
||||
*/
|
||||
function initSmoothScroll() {
|
||||
const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
||||
if (!prefersReducedMotion) {
|
||||
document.documentElement.style.scrollBehavior = 'smooth';
|
||||
}
|
||||
}
|
||||
|
||||
initSmoothScroll();
|
||||
|
||||
/**
|
||||
* Add focus-visible polyfill for older browsers
|
||||
*/
|
||||
function initFocusVisible() {
|
||||
const isKeyboardEvent = (e) => {
|
||||
return e.mozInputSource === MOZ_SOURCE_KEYBOARD ||
|
||||
e.detail === 0 ||
|
||||
(e.sourceCapabilities && e.sourceCapabilities.firesTouchEvents === false);
|
||||
};
|
||||
|
||||
document.addEventListener('mousedown', (e) => {
|
||||
document.body.classList.remove('keyboard-focus');
|
||||
}, true);
|
||||
|
||||
document.addEventListener('keydown', () => {
|
||||
document.body.classList.add('keyboard-focus');
|
||||
}, true);
|
||||
}
|
||||
|
||||
// Search overlay functionality (Peptide Search AI integration)
|
||||
const searchToggle = document.querySelector('.search-toggle');
|
||||
const searchOverlay = document.getElementById('search-overlay');
|
||||
const searchOverlayClose = document.querySelector('.search-overlay-close');
|
||||
|
||||
function openSearchOverlay() {
|
||||
if (!searchOverlay) return;
|
||||
searchOverlay.classList.add('active');
|
||||
searchOverlay.setAttribute('aria-hidden', 'false');
|
||||
document.body.style.overflow = 'hidden';
|
||||
// Focus the search input inside the overlay
|
||||
const input = searchOverlay.querySelector('.psa-search-input, .ps-search-input, input[type="search"], input[type="text"]');
|
||||
if (input) {
|
||||
setTimeout(() => input.focus(), 100);
|
||||
}
|
||||
}
|
||||
|
||||
function closeSearchOverlay() {
|
||||
if (!searchOverlay) return;
|
||||
searchOverlay.classList.remove('active');
|
||||
searchOverlay.setAttribute('aria-hidden', 'true');
|
||||
document.body.style.overflow = '';
|
||||
// Return focus to search toggle
|
||||
if (searchToggle) searchToggle.focus();
|
||||
}
|
||||
|
||||
if (searchToggle) {
|
||||
searchToggle.addEventListener('click', openSearchOverlay);
|
||||
}
|
||||
|
||||
if (searchOverlayClose) {
|
||||
searchOverlayClose.addEventListener('click', closeSearchOverlay);
|
||||
}
|
||||
|
||||
if (searchOverlay) {
|
||||
// Close overlay when clicking the backdrop
|
||||
searchOverlay.addEventListener('click', (e) => {
|
||||
if (e.target === searchOverlay) {
|
||||
closeSearchOverlay();
|
||||
}
|
||||
});
|
||||
|
||||
// Close on Escape key
|
||||
document.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Escape' && searchOverlay.classList.contains('active')) {
|
||||
closeSearchOverlay();
|
||||
}
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
164
footer.php
164
footer.php
@@ -1,82 +1,82 @@
|
||||
<?php
|
||||
/**
|
||||
* The footer for Peptide Starter theme
|
||||
*
|
||||
* @package peptide-starter
|
||||
*/
|
||||
|
||||
?>
|
||||
</main><!-- #main -->
|
||||
|
||||
<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
|
||||
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>';
|
||||
} elseif ( 2 === $i ) {
|
||||
echo '<h3>' . esc_html__( 'Quick Links', 'peptide-starter' ) . '</h3>';
|
||||
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 '</ul>';
|
||||
} elseif ( 3 === $i ) {
|
||||
echo '<h3>' . esc_html__( 'Resources', '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 '</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>';
|
||||
}
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<!-- Footer Bottom -->
|
||||
<div class="footer-bottom">
|
||||
<p><?php echo wp_kses_post( peptide_starter_get_footer_copyright() ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<?php wp_footer(); ?>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
/**
|
||||
* The footer for Peptide Starter theme
|
||||
*
|
||||
* @package peptide-starter
|
||||
*/
|
||||
|
||||
?>
|
||||
</main><!-- #main -->
|
||||
|
||||
<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
|
||||
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>';
|
||||
} elseif ( 2 === $i ) {
|
||||
echo '<h3>' . esc_html__( 'Quick Links', 'peptide-starter' ) . '</h3>';
|
||||
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 '</ul>';
|
||||
} elseif ( 3 === $i ) {
|
||||
echo '<h3>' . esc_html__( 'Resources', '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 '</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>';
|
||||
}
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<!-- Footer Bottom -->
|
||||
<div class="footer-bottom">
|
||||
<p><?php echo wp_kses_post( peptide_starter_get_footer_copyright() ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<?php wp_footer(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
170
front-page.php
170
front-page.php
@@ -1,85 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* The front page template
|
||||
*
|
||||
* @package peptide-starter
|
||||
*/
|
||||
|
||||
get_header();
|
||||
?>
|
||||
|
||||
<main id="main" class="site-main">
|
||||
<!-- Hero Section -->
|
||||
<section class="hero-section">
|
||||
<div class="hero-content">
|
||||
<h1 class="hero-title"><?php echo esc_html( peptide_starter_get_hero_title() ); ?></h1>
|
||||
<p class="hero-subtitle"><?php echo esc_html( peptide_starter_get_hero_subtitle() ); ?></p>
|
||||
|
||||
<!-- Hero Search (Peptide Search AI) -->
|
||||
<div class="hero-search">
|
||||
<?php
|
||||
if ( shortcode_exists( 'peptide_search' ) ) {
|
||||
echo do_shortcode( '[peptide_search placeholder="' . esc_attr( peptide_starter_get_search_placeholder() ) . '"]' );
|
||||
} else {
|
||||
?>
|
||||
<form class="ps-search-form" method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>">
|
||||
<input
|
||||
type="search"
|
||||
name="s"
|
||||
class="ps-search-input"
|
||||
placeholder="<?php echo esc_attr( peptide_starter_get_search_placeholder() ); ?>"
|
||||
value="<?php echo esc_attr( get_search_query() ); ?>"
|
||||
>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<!-- Hero CTAs -->
|
||||
<div class="hero-ctas">
|
||||
<a href="<?php echo esc_url( home_url( '/peptides' ) ); ?>" class="ps-btn ps-btn-primary">
|
||||
<?php esc_html_e( 'Browse Peptides', 'peptide-starter' ); ?>
|
||||
</a>
|
||||
<a href="<?php echo esc_url( home_url( '/about' ) ); ?>" class="ps-btn ps-btn-secondary">
|
||||
<?php esc_html_e( 'Learn More', 'peptide-starter' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- PRAutoBlogger Posts Widget -->
|
||||
<?php
|
||||
if ( shortcode_exists( 'prautoblogger_posts' ) ) {
|
||||
echo do_shortcode( '[prautoblogger_posts count="6" title="' . esc_attr__( 'Latest Research & Insights', 'peptide-starter' ) . '" subtitle="' . esc_attr__( 'Evidence-based articles on peptides, protocols, and emerging research', 'peptide-starter' ) . '"]' );
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- News Feed Section -->
|
||||
<?php
|
||||
// Display the Peptide News plugin shortcode if available
|
||||
if ( shortcode_exists( 'peptide_news' ) ) {
|
||||
?>
|
||||
<section class="news-feed-section">
|
||||
<div class="ps-container">
|
||||
<div class="news-feed-header">
|
||||
<h2 class="news-feed-title"><?php esc_html_e( 'Latest Peptide Research', 'peptide-starter' ); ?></h2>
|
||||
<p class="news-feed-description">
|
||||
<?php esc_html_e( 'Stay updated with the latest developments in peptide science and research.', 'peptide-starter' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<?php echo do_shortcode( '[peptide_news]' ); ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// Note: The front page layout is handled entirely by this template.
|
||||
// Old page content (e.g. from Elementor) is intentionally NOT rendered here
|
||||
// to avoid duplicate hero sections and empty space.
|
||||
?>
|
||||
</main>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
<?php
|
||||
/**
|
||||
* The front page template
|
||||
*
|
||||
* @package peptide-starter
|
||||
*/
|
||||
|
||||
get_header();
|
||||
?>
|
||||
|
||||
<main id="main" class="site-main">
|
||||
<!-- Hero Section -->
|
||||
<section class="hero-section">
|
||||
<div class="hero-content">
|
||||
<h1 class="hero-title"><?php echo esc_html( peptide_starter_get_hero_title() ); ?></h1>
|
||||
<p class="hero-subtitle"><?php echo esc_html( peptide_starter_get_hero_subtitle() ); ?></p>
|
||||
|
||||
<!-- Hero Search (Peptide Search AI) -->
|
||||
<div class="hero-search">
|
||||
<?php
|
||||
if ( shortcode_exists( 'peptide_search' ) ) {
|
||||
echo do_shortcode( '[peptide_search placeholder="' . esc_attr( peptide_starter_get_search_placeholder() ) . '"]' );
|
||||
} else {
|
||||
?>
|
||||
<form class="ps-search-form" method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>">
|
||||
<input
|
||||
type="search"
|
||||
name="s"
|
||||
class="ps-search-input"
|
||||
placeholder="<?php echo esc_attr( peptide_starter_get_search_placeholder() ); ?>"
|
||||
value="<?php echo esc_attr( get_search_query() ); ?>"
|
||||
>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<!-- Hero CTAs -->
|
||||
<div class="hero-ctas">
|
||||
<a href="<?php echo esc_url( home_url( '/peptides' ) ); ?>" class="ps-btn ps-btn-primary">
|
||||
<?php esc_html_e( 'Browse Peptides', 'peptide-starter' ); ?>
|
||||
</a>
|
||||
<a href="<?php echo esc_url( home_url( '/about' ) ); ?>" class="ps-btn ps-btn-secondary">
|
||||
<?php esc_html_e( 'Learn More', 'peptide-starter' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- PRAutoBlogger Posts Widget -->
|
||||
<?php
|
||||
if ( shortcode_exists( 'prautoblogger_posts' ) ) {
|
||||
echo do_shortcode( '[prautoblogger_posts count="6" title="' . esc_attr__( 'Latest Research & Insights', 'peptide-starter' ) . '" subtitle="' . esc_attr__( 'Evidence-based articles on peptides, protocols, and emerging research', 'peptide-starter' ) . '"]' );
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- News Feed Section -->
|
||||
<?php
|
||||
// Display the Peptide News plugin shortcode if available
|
||||
if ( shortcode_exists( 'peptide_news' ) ) {
|
||||
?>
|
||||
<section class="news-feed-section">
|
||||
<div class="ps-container">
|
||||
<div class="news-feed-header">
|
||||
<h2 class="news-feed-title"><?php esc_html_e( 'Latest Peptide Research', 'peptide-starter' ); ?></h2>
|
||||
<p class="news-feed-description">
|
||||
<?php esc_html_e( 'Stay updated with the latest developments in peptide science and research.', 'peptide-starter' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<?php echo do_shortcode( '[peptide_news]' ); ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// Note: The front page layout is handled entirely by this template.
|
||||
// Old page content (e.g. from Elementor) is intentionally NOT rendered here
|
||||
// to avoid duplicate hero sections and empty space.
|
||||
?>
|
||||
</main>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
|
||||
1042
functions.php
1042
functions.php
File diff suppressed because it is too large
Load Diff
18
header.php
18
header.php
@@ -29,14 +29,16 @@
|
||||
<!-- Primary Navigation -->
|
||||
<nav class="primary-navigation">
|
||||
<?php
|
||||
wp_nav_menu( array(
|
||||
'theme_location' => 'primary',
|
||||
'fallback_cb' => 'peptide_starter_primary_menu_fallback',
|
||||
'walker' => new Peptide_Starter_Nav_Walker(),
|
||||
'depth' => 2,
|
||||
'container' => false,
|
||||
'items_wrap' => '<ul>%3$s</ul>',
|
||||
) );
|
||||
wp_nav_menu(
|
||||
array(
|
||||
'theme_location' => 'primary',
|
||||
'fallback_cb' => 'peptide_starter_primary_menu_fallback',
|
||||
'walker' => new Peptide_Starter_Nav_Walker(),
|
||||
'depth' => 2,
|
||||
'container' => false,
|
||||
'items_wrap' => '<ul>%3$s</ul>',
|
||||
)
|
||||
);
|
||||
?>
|
||||
</nav>
|
||||
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* The search form template
|
||||
*
|
||||
* @package peptide-starter
|
||||
*/
|
||||
|
||||
?>
|
||||
<form role="search" method="get" class="ps-search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
|
||||
<label for="search" class="sr-only"><?php esc_html_e( 'Search', 'peptide-starter' ); ?></label>
|
||||
<div style="position: relative;">
|
||||
<input
|
||||
type="search"
|
||||
id="search"
|
||||
name="s"
|
||||
class="ps-search-input"
|
||||
placeholder="<?php esc_attr_e( 'Search...', 'peptide-starter' ); ?>"
|
||||
value="<?php echo esc_attr( get_search_query() ); ?>"
|
||||
>
|
||||
<button type="submit" class="ps-btn ps-btn-primary" style="position: absolute; right: 0; top: 0; border-radius: 0 var(--radius-lg) var(--radius-lg) 0;">
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M9 17C13.4183 17 17 13.4183 17 9C17 4.58172 13.4183 1 9 1C4.58172 1 1 4.58172 1 9C1 13.4183 4.58172 17 9 17Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M19 19L14.65 14.65" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<?php
|
||||
/**
|
||||
* The search form template
|
||||
*
|
||||
* @package peptide-starter
|
||||
*/
|
||||
|
||||
?>
|
||||
<form role="search" method="get" class="ps-search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
|
||||
<label for="search" class="sr-only"><?php esc_html_e( 'Search', 'peptide-starter' ); ?></label>
|
||||
<div style="position: relative;">
|
||||
<input
|
||||
type="search"
|
||||
id="search"
|
||||
name="s"
|
||||
class="ps-search-input"
|
||||
placeholder="<?php esc_attr_e( 'Search...', 'peptide-starter' ); ?>"
|
||||
value="<?php echo esc_attr( get_search_query() ); ?>"
|
||||
>
|
||||
<button type="submit" class="ps-btn ps-btn-primary" style="position: absolute; right: 0; top: 0; border-radius: 0 var(--radius-lg) var(--radius-lg) 0;">
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M9 17C13.4183 17 17 13.4183 17 9C17 4.58172 13.4183 1 9 1C4.58172 1 1 4.58172 1 9C1 13.4183 4.58172 17 9 17Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M19 19L14.65 14.65" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -39,25 +39,45 @@ get_header();
|
||||
<!-- Meta Information -->
|
||||
<div class="peptide-meta" style="margin-top: var(--spacing-3xl); padding-top: var(--spacing-2xl); border-top: 1px solid var(--color-border-default);">
|
||||
<dl>
|
||||
<?php if ( $formula = get_post_meta( get_the_ID(), 'peptide_formula', true ) ) { ?>
|
||||
<?php
|
||||
$formula = get_post_meta( get_the_ID(), 'peptide_formula', true );
|
||||
if ( $formula ) {
|
||||
?>
|
||||
<dt><strong><?php esc_html_e( 'Molecular Formula:', 'peptide-starter' ); ?></strong></dt>
|
||||
<dd><code><?php echo esc_html( $formula ); ?></code></dd>
|
||||
<?php } ?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ( $sequence = get_post_meta( get_the_ID(), 'peptide_sequence', true ) ) { ?>
|
||||
<?php
|
||||
$sequence = get_post_meta( get_the_ID(), 'peptide_sequence', true );
|
||||
if ( $sequence ) {
|
||||
?>
|
||||
<dt><strong><?php esc_html_e( 'Sequence:', 'peptide-starter' ); ?></strong></dt>
|
||||
<dd><code><?php echo esc_html( $sequence ); ?></code></dd>
|
||||
<?php } ?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ( $molecular_weight = get_post_meta( get_the_ID(), 'peptide_molecular_weight', true ) ) { ?>
|
||||
<?php
|
||||
$molecular_weight = get_post_meta( get_the_ID(), 'peptide_molecular_weight', true );
|
||||
if ( $molecular_weight ) {
|
||||
?>
|
||||
<dt><strong><?php esc_html_e( 'Molecular Weight:', 'peptide-starter' ); ?></strong></dt>
|
||||
<dd><?php echo esc_html( $molecular_weight ); ?> Da</dd>
|
||||
<?php } ?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ( $therapeutic_use = get_post_meta( get_the_ID(), 'peptide_therapeutic_use', true ) ) { ?>
|
||||
<?php
|
||||
$therapeutic_use = get_post_meta( get_the_ID(), 'peptide_therapeutic_use', true );
|
||||
if ( $therapeutic_use ) {
|
||||
?>
|
||||
<dt><strong><?php esc_html_e( 'Therapeutic Use:', 'peptide-starter' ); ?></strong></dt>
|
||||
<dd><?php echo esc_html( $therapeutic_use ); ?></dd>
|
||||
<?php } ?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<?php
|
||||
if ( is_search() ) {
|
||||
?>
|
||||
<p><?php esc_html_e( "Sorry, but nothing matched your search terms. Please try again with some different keywords.", 'peptide-starter' ); ?></p>
|
||||
<p><?php esc_html_e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'peptide-starter' ); ?></p>
|
||||
<?php
|
||||
get_search_form();
|
||||
} elseif ( is_home() && current_user_can( 'publish_posts' ) ) {
|
||||
@@ -38,11 +38,11 @@
|
||||
<?php
|
||||
} elseif ( is_archive() ) {
|
||||
?>
|
||||
<p><?php esc_html_e( "It looks like there are no posts for this archive. Try a different category or date.", 'peptide-starter' ); ?></p>
|
||||
<p><?php esc_html_e( 'It looks like there are no posts for this archive. Try a different category or date.', 'peptide-starter' ); ?></p>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<p><?php esc_html_e( "It seems we can't find what you're looking for. Perhaps searching can help.", 'peptide-starter' ); ?></p>
|
||||
<p><?php esc_html_e( 'It seems we can\'t find what you\'re looking for. Perhaps searching can help.', 'peptide-starter' ); ?></p>
|
||||
<?php
|
||||
get_search_form();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user