fix(theme): complete namespace swap + page-hero/aura-bg placement + single.spec gating

This commit is contained in:
Keith Solomon
2026-08-16 14:23:04 -05:00
parent ca9c5f215c
commit afa594aa0a
38 changed files with 81 additions and 65 deletions
+1 -1
View File
@@ -15,6 +15,7 @@ if ( ! $hero_intro ) {
}
?>
<section class="archive-projects aura-bg">
<?php get_template_part( 'views/partials/aura-bg' ); ?>
<div class="aura-bg__content">
<div class="container mx-auto my-section">
<header class="archive-projects__head">
@@ -54,5 +55,4 @@ if ( ! $hero_intro ) {
</section>
<?php
get_template_part( 'views/partials/aura-bg' );
get_footer();
+1 -1
View File
@@ -2,7 +2,7 @@
/**
* Theme footer template
*
* @package SoloFrameEvo
* @package KsPortfolio
* @since 1.0.0
*/
+1 -1
View File
@@ -15,6 +15,7 @@ $hero_cta_1 = get_field( 'homepage_hero_cta_1' ); // ACF link fields return sh
$hero_cta_2 = get_field( 'homepage_hero_cta_2' );
?>
<section class="home-hero aura-bg">
<?php get_template_part( 'views/partials/aura-bg' ); ?>
<div class="aura-bg__content">
<div class="container mx-auto my-section">
<div class="home-hero__inner">
@@ -80,5 +81,4 @@ $hero_cta_2 = get_field( 'homepage_hero_cta_2' );
</section>
<?php
get_template_part( 'views/partials/aura-bg' );
get_footer();
+2 -2
View File
@@ -1,11 +1,11 @@
<?php
/**
* Functions file for the SoloFrameEvo theme.
* Functions file for the KsPortfolio theme.
*
* This file initializes the theme by including necessary dependencies
* and loading additional function files.
*
* @package SoloFrameEvo
* @package KsPortfolio
* @since 1.0.0
*/
+17 -1
View File
@@ -2,7 +2,7 @@
/**
* Theme header template
*
* @package SoloFrameEvo
* @package KsPortfolio
* @since 1.0.0
*/
@@ -26,6 +26,22 @@ $showHero = in_array(
true
);
// Carbon Blue project templates render their own <h1> inside the .aura-bg
// hero, so suppress the page-hero partial on those templates to avoid
// duplicate <h1> elements on the page.
$projectTemplates = array( 'front-page', 'archive-projects', 'single-projects' );
$isProjectTemplate = in_array( get_page_template_slug( get_the_ID() ), $projectTemplates, true );
if ( ! $isProjectTemplate ) {
$isProjectTemplate = in_array( get_post_type(), array( 'projects' ), true ) && (
is_front_page()
|| is_archive( 'projects' )
|| is_singular( 'projects' )
);
}
if ( $isProjectTemplate ) {
$showHero = false;
}
?>
<!DOCTYPE html>
+1 -1
View File
@@ -2,7 +2,7 @@
/**
* ACF (Advanced Custom Fields) support class & functions
*
* @package SoloFrameEvo
* @package KsPortfolio
* @since 1.0.0
*/
+2 -2
View File
@@ -1,8 +1,8 @@
<?php
/**
* SoloFrameEvo Theme Enqueue Class
* KsPortfolio Theme Enqueue Class
*
* @package SoloFrameEvo
* @package KsPortfolio
* @since 1.0.0
*/
+2 -2
View File
@@ -1,8 +1,8 @@
<?php
/**
* SoloFrameEvo MenuItems Class
* KsPortfolio MenuItems Class
*
* @package SoloFrameEvo
* @package KsPortfolio
* @since 1.0.0
*/
+1 -1
View File
@@ -2,7 +2,7 @@
/**
* Resources custom post type & taxonomies
*
* @package SoloFrameEvo
* @package KsPortfolio
* @since 1.0.0
*/
+1 -1
View File
@@ -2,7 +2,7 @@
/**
* Filters. etc
*
* @package SoloFrameEvo
* @package KsPortfolio
* @since 1.0.0
*/
+2 -2
View File
@@ -1,8 +1,8 @@
<?php
/**
* SoloFrameEvo Theme Helpers
* KsPortfolio Theme Helpers
*
* @package SoloFrameEvo
* @package KsPortfolio
* @since 1.0.0
*/
+2 -2
View File
@@ -1,8 +1,8 @@
<?php
/**
* SoloFrameEvo Theme Hooks
* KsPortfolio Theme Hooks
*
* @package SoloFrameEvo
* @package KsPortfolio
* @since 1.0.0
*/
+2 -2
View File
@@ -1,8 +1,8 @@
<?php
/**
* Search features for SoloFrameEvo theme.
* Search features for KsPortfolio theme.
*
* @package SoloFrameEvo
* @package KsPortfolio
* @since 1.0.0
*/
+2 -2
View File
@@ -2,7 +2,7 @@
/**
* Add a comment to show which template is being used on the current page.
*
* @package SoloFrameEvo
* @package KsPortfolio
* @since 1.0.0
*/
@@ -14,7 +14,7 @@ namespace KsPortfolio;
* Displays the active WordPress template in the footer for debugging purposes.
* Determines which template WordPress has chosen to use and outputs it as an HTML comment.
*
* @package SoloFrameEvo
* @package KsPortfolio
* @since 1.0.0
*/
class ShowTemplate {
+2 -2
View File
@@ -2,10 +2,10 @@
/**
* Page Sidebar
*
* @package SoloFrameEvo
* @package KsPortfolio
*/
namespace SoloFrameEvo;
namespace KsPortfolio;
?>
+2 -2
View File
@@ -2,10 +2,10 @@
/**
* Sidebar
*
* @package SoloFrameEvo
* @package KsPortfolio
*/
namespace SoloFrameEvo;
namespace KsPortfolio;
?>
+1 -1
View File
@@ -28,6 +28,7 @@ while ( have_posts() ) :
$excerpt = has_excerpt( $project_id ) ? get_the_excerpt( $project_id ) : '';
?>
<article class="single-project aura-bg">
<?php get_template_part( 'views/partials/aura-bg' ); ?>
<div class="aura-bg__content">
<div class="container mx-auto my-section">
@@ -164,5 +165,4 @@ while ( have_posts() ) :
<?php
endwhile;
get_template_part( 'views/partials/aura-bg' );
get_footer();
+1 -1
View File
@@ -13,6 +13,7 @@ $queried = get_queried_object();
$term_name = $queried && ! is_wp_error( $queried ) ? $queried->name : __( 'Projects', 'ks-portfolio' );
?>
<section class="archive-projects aura-bg">
<?php get_template_part( 'views/partials/aura-bg' ); ?>
<div class="aura-bg__content">
<div class="container mx-auto my-section">
<header class="archive-projects__head">
@@ -56,5 +57,4 @@ $term_name = $queried && ! is_wp_error( $queried ) ? $queried->name : __( 'Proje
</section>
<?php
get_template_part( 'views/partials/aura-bg' );
get_footer();
+5 -5
View File
@@ -5,15 +5,15 @@ test.use({ viewport: { width: 1920, height: 1080 } });
test.describe('single-project', () => {
test('project detail renders hero, sidebar, no axe violations', async ({ page }, testInfo) => {
// Pick the first project; skip the test gracefully if none exist.
// Navigate to the projects archive and pick the first card. The test
// fails (not skips) when no projects exist — silently skipping masks
// regression of the single-project template itself.
const response = await page.goto('/projects/');
expect(response && response.status()).toBeLessThan(400);
const firstLink = page.locator('.archive-projects__grid a.project-card__title-link').first();
if (await firstLink.count() === 0) {
test.skip(true, 'No projects to test detail page');
return;
}
const linkCount = await firstLink.count();
expect(linkCount, 'archive must contain at least one project card to exercise the single-project template').toBeGreaterThan(0);
await Promise.all([
page.waitForLoadState('networkidle'),
+2 -2
View File
@@ -4,10 +4,10 @@
*
* This is the template that renders the Accordion block.
*
* @package SoloFrameEvo
* @package KsPortfolio
*/
namespace SoloFrameEvo;
namespace KsPortfolio;
$open = get_field( 'open' );
$group = get_field( 'group_items' );
+2 -2
View File
@@ -4,10 +4,10 @@
*
* This is the template for building your own custom blocks.
*
* @package SoloFrameEvo
* @package KsPortfolio
*/
namespace SoloFrameEvo;
namespace KsPortfolio;
$classes = 'boilerplate';
+2 -2
View File
@@ -2,10 +2,10 @@
/**
* Button block
*
* @package SoloFrameEvo
* @package KsPortfolio
*/
namespace SoloFrameEvo;
namespace KsPortfolio;
// Retrieve ACF fields
$element = get_field( 'element' ) ? get_field( 'element' ) : 'a';
+2 -2
View File
@@ -4,10 +4,10 @@
*
* This is the template that renders the Buttons block.
*
* @package SoloFrameEvo
* @package KsPortfolio
*/
namespace SoloFrameEvo;
namespace KsPortfolio;
$ibClasses = 'flex flex-wrap gap-4 w-full justify-center sm:justify-start';
+2 -2
View File
@@ -4,10 +4,10 @@
*
* Display contact information from global fields with icons and optional form.
*
* @package SoloFrameEvo
* @package KsPortfolio
*/
namespace SoloFrameEvo;
namespace KsPortfolio;
$classes = 'contact-info';
$wrapper = blockWrapperAttributes( $classes, $is_preview );
+2 -2
View File
@@ -4,10 +4,10 @@
*
* This is the template that displays the Grid Cell block.
*
* @package SoloFrameEvo
* @package KsPortfolio
*/
namespace SoloFrameEvo;
namespace KsPortfolio;
// Initialize variables
$className = ! empty( $block['className'] ) ? $block['className'] : '';
+2 -2
View File
@@ -4,10 +4,10 @@
*
* This is the template that displays the grid block.
*
* @package SoloFrameEvo
* @package KsPortfolio
*/
namespace SoloFrameEvo;
namespace KsPortfolio;
$allowedBlocks = array( 'acf/grid-cell' );
$default_blocks = array(
+2 -2
View File
@@ -2,10 +2,10 @@
/**
* Block Name: Homepage Hero
*
* @package SoloFrameEvo
* @package KsPortfolio
*/
namespace SoloFrameEvo;
namespace KsPortfolio;
// Retrieve ACF fields
$heading = get_field( 'heading' );
@@ -4,10 +4,10 @@
*
* This is the template that displays the media text inner blocks.
*
* @package SoloFrameEvo
* @package KsPortfolio
*/
namespace SoloFrameEvo;
namespace KsPortfolio;
// Retrieve ACF fields
$bgColor = get_field( 'background_color' ) ? get_field( 'background_color' ) : '#c5c5c5';
+2 -2
View File
@@ -4,10 +4,10 @@
*
* This is the template that displays the Media With Text block.
*
* @package SoloFrameEvo
* @package KsPortfolio
*/
namespace SoloFrameEvo;
namespace KsPortfolio;
// Retrieve ACF fields
$bgColor = get_field( 'background_color' ) ? get_field( 'background_color' ) : '#c5c5c5';
+2 -2
View File
@@ -2,10 +2,10 @@
/**
* Page Children block
*
* @package SoloFrameEvo
* @package KsPortfolio
*/
namespace SoloFrameEvo;
namespace KsPortfolio;
// Retrieve the current page ID and its children
$parentId = get_queried_object_id();
+2 -2
View File
@@ -4,10 +4,10 @@
*
* This is the template that displays the section block.
*
* @package SoloFrameEvo
* @package KsPortfolio
*/
namespace SoloFrameEvo;
namespace KsPortfolio;
// Retrieve ACF fields
$contentWidth = get_field( 'content_width' );
+1 -1
View File
@@ -6,7 +6,7 @@
* https://docs.vincentdevelopment.ca/docs/starter-v3-enhancements/navigation/
*/
namespace SoloFrameEvo;
namespace KsPortfolio;
// Variables available:
// $item from parent template
+1 -1
View File
@@ -6,7 +6,7 @@
* https://docs.vincentdevelopment.ca/docs/starter-v3-enhancements/navigation/
*/
namespace SoloFrameEvo;
namespace KsPortfolio;
// Variables available from MenuItems component:
// $topLevelNavItems, $hasChildren, $nestedNavItems, $currentPage, $location
+1 -1
View File
@@ -6,7 +6,7 @@
* https://docs.vincentdevelopment.ca/docs/starter-v3-enhancements/navigation/
*/
namespace SoloFrameEvo;
namespace KsPortfolio;
// Variables available:
// $item from parent template
+1 -1
View File
@@ -6,7 +6,7 @@
* https://docs.vincentdevelopment.ca/docs/starter-v3-enhancements/navigation/
*/
namespace SoloFrameEvo;
namespace KsPortfolio;
global $views;
?>
+1 -1
View File
@@ -6,7 +6,7 @@
* https://docs.vincentdevelopment.ca/docs/starter-v3-enhancements/navigation/
*/
namespace SoloFrameEvo;
namespace KsPortfolio;
// Init Variables
$navIcon = isset( get_field( 'header', 'option' )['nav_icon'] ) ? get_field( 'header', 'option' )['nav_icon'] : '';
+2 -2
View File
@@ -14,7 +14,7 @@ namespace KsPortfolio;
<form method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>" class="global-search-form relative flex justify-start max-w-full w-full">
<label for="globalSearch">
<svg role="img" aria-labelledby="globalSearchLabel" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="absolute w-4 top-2 left-2 fill-primary-700">
<title id="globalSearchLabel"><?php echo esc_attr_x( 'Search', 'search-label', 'sf-evo' ); ?></title>
<title id="globalSearchLabel"><?php echo esc_attr_x( 'Search', 'search-label', 'ks-portfolio' ); ?></title>
<path d="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"/>
</svg>
@@ -23,7 +23,7 @@ namespace KsPortfolio;
<input id="globalSearch" type="search" placeholder="" value="<?php echo esc_attr( get_search_query() ); ?>" name="s" class="md:min-w-[25ch] w-full md:w-[18em] max-w-full text-sm p-1 pl-7 border-2 border-primary-700 rounded-l focus-visible:ring-2 ring-primary-700 outline-default!">
<button type="submit" class="bg-primary rounded-r py-0 px-3 height-full text-sm text-white focus-visible:ring-2 ring-primary-700 outline-default! cursor-default">
<?php echo esc_attr_x( 'Search', 'search-submit', 'sf-evo' ); ?>
<?php echo esc_attr_x( 'Search', 'search-submit', 'ks-portfolio' ); ?>
</button>
</form>
</search>
+2 -2
View File
@@ -6,11 +6,11 @@
* These are for use in the editor and do not appear in the theme codebase, so
* Tailwind does not know to include them without this list.
*
* @package SoloFrameEvo
* @package KsPortfolio
* @since 1.0.0
*/
namespace SoloFrameEvo;
namespace KsPortfolio;
?>